mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 06:05:11 +00:00
9164179b50
Co-authored-by: Pooya Parsa <pyapar@gmail.com>
12 lines
394 B
Markdown
12 lines
394 B
Markdown
# Server Middleware
|
||
|
||
Nuxt will automatically read in any files in the `~/server/middleware` to create server middleware for your project. (These files will be run on every request, unliked [API routes](./api) that are mapped to their own routes.)
|
||
|
||
Each file should export a default function that will handle a request.
|
||
|
||
```js
|
||
export default async (req, res) => {
|
||
req.someValue = true
|
||
}
|
||
```
|