io.muserver.RouteHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mu-server Show documentation
Show all versions of mu-server Show documentation
A simple but powerful web server framework
package io.muserver;
import java.util.Map;
public interface RouteHandler {
/**
* A handler for a Route created with {@link MuServerBuilder#addHandler(Method, String, RouteHandler)}
* or {@link Routes#route(Method, String, RouteHandler)}
* @param request The request
* @param response The response
* @param pathParams A map of path parameters, for example id
would equal "123"
* if the route URI template was /things/{id : [0-9]+}
and the requested URI was
* /things/123
* @throws Exception Throwing an exception will result in a 500
error code being returned.
*/
void handle(MuRequest request, MuResponse response, Map pathParams) throws Exception;
}