diff --git a/docs/content/2.guide/2.directory-structure/1.server.md b/docs/content/2.guide/2.directory-structure/1.server.md index ff942672fb7..5bf170d59c0 100644 --- a/docs/content/2.guide/2.directory-structure/1.server.md +++ b/docs/content/2.guide/2.directory-structure/1.server.md @@ -66,6 +66,21 @@ export default defineEventHandler((event) => { }) ``` +## Server Plugins + +Nuxt will automatically read any files in the `~/server/plugins` directory and register them as Nitro plugins. This allows extending Nitro's runtime behavior and hooking into lifecycle events. + +**Example:** + +```ts [server/plugins/nitroPlugin.ts] +export default defineNitroPlugin((nitroApp) => { + console.log('Nitro plugin', nitroApp) +}) +``` + +::ReadMore{link="https://nitro.unjs.io/guide/advanced/plugins" title="Nitro Plugins"} +:: + ## Server Utilities Server routes are powered by [unjs/h3](https://github.com/unjs/h3) which comes with a handy set of helpers.