Connect class
A macro that in combination with Controller macro will register a route
Requirements:
- method must be inside a class annotated with Controller
- method can't have optional parameters
- can optionally return
Response
and accept aRequest
- instead of
Response
you can also use following types:
@Controller()
class MyController {
@Get('/hello')
Response hello(Request r) => Response.ok('Hello');
@Get('/wave')
String wave() => '_o/';
}
See also:
- Controller, which is required for a route to be registered.
Constructors
- Connect.new(String route)
-
A macro that in combination with
Controller macro will register a route
const
Properties
Methods
-
buildDeclarationsForMethod(
MethodDeclaration method, MemberDeclarationBuilder builder) → Future< void> -
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