Class: Implementation
| Defined in: | src/implementation.coffee |
Direct Known Subclasses
Instance Method Summary
- - (void) constructor() Constructor
- - (void) getActions()
- - (void) getMountedRoutes()
- - (void) putAction(name, action)
- - (void) removeAction(name)
- - (void) setResponder(responder)
- - (void) getResponder(responder)
- - (void) use(middlewares, options = {}) Sets up one or more middleware to be used.
- - (void) middlewaresFor(action) Private
- - (void) mount(resource, app, mountPoint = "/")
Constructor Details
- (void) constructor()
Instance Method Details
- (void) getActions()
- (void) getMountedRoutes()
- (void) putAction(name, action)
- (void) removeAction(name)
- (void) setResponder(responder)
- (void) getResponder(responder)
- (void) use(middlewares, options = {})
Sets up one or more middleware to be used.
You can also specify conditions to decide whether to use a middleware or not depending on the invoked action.
Examples:
Using a middleware for any action
impl.use(authMiddleware);
Using a middleware only for unsafe HTTP methods
impl.use(authMiddleware, {if: function(action){
return action.method != "get";
}});
- (void) middlewaresFor(action) (private)
- (void) mount(resource, app, mountPoint = "/")