Takes an array of Express Handlers or a single Express Handler. The handler(s) will be called after
each @Route method in the @Routable class.
An array or single instance of IAuthenticatorConstructor. SakuraApi works through the authenticators
left to right. If all of them fail, the first failure is returned. If and @Route method defines
authenticators, those will be handled first (they're appended to the left of the array for that route).
String defining the base endpoint for all routes defined in this @Routable() class.
@Routable({ baseUrl: 'user' }) class User { @Route({ path: '/', method: 'post' }) postNewUser(req, res) { res.sendStatus(OK); } }
The above example would setup postNewUser(...) to respond to POST requests directed to the /user endpoint.
Takes an array of Express Handlers or a single Express Handler. The handler(s) will be called before
each @Route method in the @Routable class.
Array of of method names (strings) defining which routes are ignored during route setup. Defaults to [].
An array of strings for which APIs to expose when @Routable is bound to a model. Valid values include:
If suppressApi is set, exposeApi will throw an error.
A class that is decorated with @Model for which this @Routable class will automatically create CRUD
route handlers.
An array of strings for which APIs to suppress when @Routable is bound to a model. Valid values include:
Alternatively, you can supply a boolean 'true' to suppress all endpoints from being included. This is helpful
when you want the built in handlers for @Route's before and after functionality, but you have no need
for the built in endpoints.
If exposeApi is set, suppressApi will throw an error.
Generated using TypeDoc
Interface defining the valid options for the
@Routable decorator.