Releases: BackendStack21/restana
Releases · BackendStack21/restana
Improves express compatibility
Improves support for express based middlewares by populating req.originalUrl
req.originalUrl === req.url // -> TRUE
More details: #45
Minor fix on error handler support
Calling next(err)
within middlewares will now also trigger the global errorHandler if present.
Expose internal HTTP Server instance
Merge pull request #42 from jkyberneees/expose-http-server Expose internal http server
Making errorHandler optional for typescript
Fixes restana config options definitions:
- Make
errorHandler
an optional property.
Properly handler error codes
Prevent invalid status codes from being send in case of errors.
Drop turbo-http support.
Support for turbo-http
was dropped in v3.x.
As it shows very low level and not fully compatible with Node.js native HTTP interfaces, limiting the evolution of the features we can support.
Improving error handling
Supporting global error handler overwrite:
const service = require('restana')({
errorHandler (err, req, res) {
console.log(`Unexpected error: ${err.message}`)
res.send(err)
}
})
service.get('/throw', (req, res) => {
throw new Error('Upps!')
})
service.start()
TS definitions !!!
properly exposing service options through getConfigOptions
// accessing service configuration
service.getConfigOptions()
Details: #30
Support method chaining on routes registration
Restana now supports:
service
.get('/', ...)
.post('/', ...)
.get('/chain', ...)