Mount class
Mounts a Router instance at the specified path.
Use this annotation on controller methods that return a Router instance to mount that router at the specified path relative to the controller's base path. This is useful for creating nested routers or modular routing structures.
Example:
@Controller('/api')
class ApiController {
final UserController _userController;
ApiController(this._userController);
@Mount('/users') // Mounts the user router at /api/users
Router get userRouter => _userController.router;
@Get('/status')
Response getApiStatus(Request request) {
return Response.ok(jsonEncode({'status': 'online'}));
}
}
Properties
Methods
-
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