diff --git a/docs/content/3.docs/2.directory-structure/12.server.md b/docs/content/3.docs/2.directory-structure/12.server.md index 80b387a060..ca520c7514 100644 --- a/docs/content/3.docs/2.directory-structure/12.server.md +++ b/docs/content/3.docs/2.directory-structure/12.server.md @@ -53,7 +53,7 @@ export default async (req: IncomingMessage, res: ServerResponse) => { 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, unlike [API routes](./api) that are mapped to their own routes. This is typically so you can add a common header to all responses, log responses or modify the incoming request object for later use in the request chain. +These files will be run on every request, unlike [API routes](#api-routes) that are mapped to their own routes. This is typically so you can add a common header to all responses, log responses or modify the incoming request object for later use in the request chain. Each file should export a default function that will handle a request. @@ -73,4 +73,4 @@ export default async (req: IncomingMessage, res: ServerResponse) => { } ``` -More information about custom middleware can be found in the documentation for [nuxt.config.js](./nuxt.config#servermiddleware) +More information about custom middleware can be found in the documentation for [nuxt.config.js](/docs/directory-structure/nuxt.config#servermiddleware)