mirror of
https://github.com/typicode/json-server.git
synced 2025-07-27 20:23:34 +08:00
fix middlewares example (#385)
This commit is contained in:
@ -269,9 +269,10 @@ Now you can access resources using additional routes.
|
|||||||
You can add your middlewares from the CLI using `--middlewares` option:
|
You can add your middlewares from the CLI using `--middlewares` option:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
// first.js
|
// hello.js
|
||||||
module.exports = function (req, res, next) {
|
module.exports = function (req, res, next) {
|
||||||
res.header('X-Hello', 'World')
|
res.header('X-Hello', 'World')
|
||||||
|
next()
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user