Muxable class
Properties
-
hashCode
→ int
-
The hash code for this object. [...]
read-only, inherited
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
add(Iterable<Route> routes)
→ void
-
-
addRoute(Route route)
→ Route
-
Adds a route to the muxer
-
delete(String path, RouteHandler handler, { Map<String, String> pathRegEx, int statusCode: 200, String mimeType, String charset: kDefaultCharset, ResponseProcessor responseProcessor, List<RouteInterceptor> after, List<RouteInterceptor> before, List<ExceptionHandler> onException })
→ Route
-
Adds a route with DELETE method to be served
-
deleteJson(String path, RouteHandler handler, { Map<String, String> pathRegEx, int statusCode: 200, String mimeType, String charset: kDefaultCharset, ResponseProcessor responseProcessor: jsonResponseProcessor, List<RouteInterceptor> after, List<RouteInterceptor> before, List<ExceptionHandler> onException })
→ Route
-
Adds a route with DELETE method to be served
-
get(String path, RouteHandler handler, { Map<String, String> pathRegEx, int statusCode: 200, String mimeType, String charset: kDefaultCharset, ResponseProcessor responseProcessor, List<RouteInterceptor> after, List<RouteInterceptor> before, List<ExceptionHandler> onException })
→ Route
-
Adds a route with GET method to be served
-
getJson(String path, RouteHandler handler, { Map<String, String> pathRegEx, int statusCode: 200, String mimeType, String charset: kDefaultCharset, ResponseProcessor responseProcessor: jsonResponseProcessor, List<RouteInterceptor> after, List<RouteInterceptor> before, List<ExceptionHandler> onException })
→ Route
-
Adds a route with GET method to be served
-
html(String path, RouteHandler handler, { Map<String, String> pathRegEx, int statusCode: 200, String mimeType: MimeTypes.html, String charset: kDefaultCharset, ResponseProcessor responseProcessor, List<RouteInterceptor> after, List<RouteInterceptor> before, List<ExceptionHandler> onException })
→ Route
-
Adds a route with GET method to be served
-
json(String path, RouteHandler handler, { Map<String, String> pathRegEx, List<String> methods: const ['GET', 'PUT', 'POST', 'DELETE'], int statusCode: 200, String mimeType, String charset: kDefaultCharset, ResponseProcessor responseProcessor: jsonResponseProcessor, List<RouteInterceptor> after, List<RouteInterceptor> before, List<ExceptionHandler> onException })
→ Route
-
Adds a route to be served
-
map(Map<String, dynamic> handlers, { List<RouteInterceptor> before: const [], List<RouteInterceptor> after: const [], List<ExceptionHandler> onException: const [] })
→ void
-
-
options(String path, RouteHandler handler, { Map<String, String> pathRegEx, int statusCode: 200, String mimeType, String charset: kDefaultCharset, ResponseProcessor responseProcessor, List<RouteInterceptor> after, List<RouteInterceptor> before, List<ExceptionHandler> onException })
→ Route
-
Adds a route with OPTIONS method to be served
-
patch(String path, RouteHandler handler, { Map<String, String> pathRegEx, int statusCode: 200, String mimeType, String charset: kDefaultCharset, ResponseProcessor responseProcessor, List<RouteInterceptor> after, List<RouteInterceptor> before, List<ExceptionHandler> onException })
→ Route
-
Adds a route with PATCH method to be served
-
post(String path, RouteHandler handler, { Map<String, String> pathRegEx, int statusCode: 200, String mimeType, String charset: kDefaultCharset, ResponseProcessor responseProcessor, List<RouteInterceptor> after, List<RouteInterceptor> before, List<ExceptionHandler> onException })
→ Route
-
Adds a route with POST method to be served
-
postJson(String path, RouteHandler handler, { Map<String, String> pathRegEx, int statusCode: 200, String mimeType, String charset: kDefaultCharset, ResponseProcessor responseProcessor: jsonResponseProcessor, List<RouteInterceptor> after, List<RouteInterceptor> before, List<ExceptionHandler> onException })
→ Route
-
Adds a route with POST method to be served
-
put(String path, RouteHandler handler, { Map<String, String> pathRegEx, int statusCode: 200, String mimeType, String charset: kDefaultCharset, ResponseProcessor responseProcessor, List<RouteInterceptor> after, List<RouteInterceptor> before, List<ExceptionHandler> onException })
→ Route
-
Adds a route with PUT method to be served
-
putJson(String path, RouteHandler handler, { Map<String, String> pathRegEx, int statusCode: 200, String mimeType, String charset: kDefaultCharset, ResponseProcessor responseProcessor: jsonResponseProcessor, List<RouteInterceptor> after, List<RouteInterceptor> before, List<ExceptionHandler> onException })
→ Route
-
Adds a route with PUT method to be served
-
route(String path, RouteHandler handler, { Map<String, String> pathRegEx, List<String> methods: const ['GET', 'PUT', 'POST', 'DELETE'], int statusCode: 200, String mimeType, String charset: kDefaultCharset, ResponseProcessor responseProcessor, List<RouteInterceptor> after, List<RouteInterceptor> before, List<ExceptionHandler> onException })
→ Route
-
Adds a route to be served
-
staticFile(String path, dynamic file, { Map<String, String> pathRegEx, int statusCode: 200, String mimeType, String charset: kDefaultCharset, ResponseProcessor responseProcessor })
→ Route
-
Serves requests at
path
with content of file
[...]
-
staticFiles(String path, dynamic directory, { Map<String, String> pathRegEx, int statusCode: 200, String mimeType, String charset: kDefaultCharset, ResponseProcessor responseProcessor, bool stripPrefix: true, Future<Response> directoryLister(Directory directory) })
→ Route
-
Serves requests for static files at
path
from directory
[...]
-
ws(String path, { Map<String, String> pathRegEx, WsHandler handler, FutureOr onConnect(Context ctx, WebSocket ws), WsResultProcessor resultProcessor, List<RouteInterceptor> after, List<RouteInterceptor> before, List<ExceptionHandler> onException })
→ Route
-
Example:
server.ws('/ws', (String data) => int.parse(data) + 1);
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a non-existent method or property is accessed. [...]
inherited
-
toString()
→ String
-
Returns a string representation of this object.
inherited