Comparing version 4.0.3 to 4.0.4
{ | ||
"name": "restana", | ||
"version": "4.0.3", | ||
"version": "4.0.4", | ||
"description": "Super fast and minimalist web framework for building REST micro-services.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -181,2 +181,17 @@ # restana | ||
``` | ||
### Nested routers | ||
Nested routers are supported as well: | ||
```js | ||
const service = require('restana')() | ||
const nestedRouter = service.newRouter() | ||
nestedRouter.get('/hello', (req, res) => { | ||
res.send('Hello World!') | ||
}) | ||
service.use('/v1', nestedRouter) | ||
... | ||
``` | ||
In this example the router routes will be available under `/v1` prefix. For example: `GET /v1/hello` | ||
#### Third party middlewares support: | ||
@@ -236,2 +251,19 @@ > All middlewares using the `function (req, res, next)` signature format are compatible with restana. | ||
## Cloud Functions for Firebase Integration | ||
`restana` restana based services can also run as Cloud Functions for Firebase 🚀 | ||
```js | ||
// required dependencies | ||
const functions = require("firebase-functions"); | ||
const restana = require('restana') | ||
// creating service | ||
const service = restana() | ||
service.get('/hello', (req, res) => { | ||
res.send('Hello World!') | ||
}) | ||
// lambda integration | ||
exports = module.exports = functions.https.onRequest(app.callback()); | ||
``` | ||
## Serving static files | ||
@@ -310,2 +342,2 @@ You can read more about serving static files with restana in this link: | ||
#### Removed | ||
- Support for `turbo-http` library was dropped. | ||
- Support for `turbo-http` library was dropped. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20483
341