Route class abstract

A Route defines a destination in Serverpod's web server. It will handle a call and generate an appropriate response by manipulating the Request object. You override Route, or more likely it's subclass WidgetRoute to create your own custom routes in your server.

Inheritance
Implementers

Constructors

Route({Set<Method> methods = const {Method.get}, String path = '/'})
Creates a new Route.

Properties

asHandler Handler
Returns this HandlerObject as a Handler.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
methods Set<Method>
The methods this route will respond to, i.e. HTTP get or post.
final
path String
The suffix path this route will respond to.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

call(Request context) FutureOr<Result>
Handles a call to this route, by extracting Session from context and forwarding to handleCall.
override
handleCall(Session session, Request context) FutureOr<Result>
Handles a call to this route.
injectIn(RelicRouter router) → void
Adds this handler to the given router with Method.get and path '/' Override to add differently.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited