The HTTP method for the route.
Optional
baseRoute: stringThe base route path for the route.
Optional
modifiesAuthentication: booleanIndicates if the route modifies authentication. If true all Websocket Outbounds with tag will be re-sent automatically.
Optional
propertyKey: stringPreparations for a simple login route:
This method can be called by sending a message using method auth.login
.
The response (return value of the method) is sent to the client using m.auth.login
.
@Route("auth")
class Auth {
@Route("login")
async login(credentials: any, connection: WebsocketConnection): Promise<any> {
// check authentication for provided credentials.
if (authenticated)
return true;
else
return false;
}
}
Generated using TypeDoc
Route decorator for WebSocket routes. Can be used to register WebSocket routes. This annotation can be used for methods and classes.
Supported Decorators:
@Auth
@Modifies
and@ModifiesFor
@ModifiesAuthentication