Middleware
March 25, 2019 ยท View on GitHub
For validation and self controlled responses you can select middleware as response. The middleware function will be called, in case of "middleware" is selected. It's response can be a string which will continue with the given string as selected response. If you return null or undefined you have to implement the response by yourself.
Parameter[0] serverOptions
Parameter[1] requestOptions
| attribute | type | description |
|---|---|---|
| req | Object | The (request object)[http://expressjs.com/en/api.html#req]. |
| res | Object | The (response object)[http://expressjs.com/en/api.html#res]. |
| method | string | Contains a string corresponding to the HTTP method of the request: GET, POST, PUT, and so on. |
| dir | string | The directory of selected response |
| preferences | Object | The preferences object |