mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 07:32:01 +00:00
docs: extend description of server handlers (#7187)
Co-authored-by: Damian Głowala <48835293+DamianGlowala@users.noreply.github.com>
This commit is contained in:
parent
908c95035b
commit
27c11884b4
@ -15,9 +15,23 @@ export default defineUntypedSchema({
|
|||||||
/**
|
/**
|
||||||
* Nitro server handlers.
|
* Nitro server handlers.
|
||||||
*
|
*
|
||||||
* @see https://nitro.unjs.io/guide/introduction/routing
|
* Each handler accepts the following options:
|
||||||
|
* - handler: The path to the file defining the handler.
|
||||||
|
* - route: The route under which the handler is available. This follows the conventions of https://github.com/unjs/radix3.
|
||||||
|
* - method: The HTTP method of requests that should be handled.
|
||||||
|
* - middleware: Specifies whether it is a middleware handler.
|
||||||
|
* - lazy: Specifies whether to use lazy loading to import the handler.
|
||||||
*
|
*
|
||||||
* **Note:** Files from `server/api`, `server/middleware` and `server/routes` will be automatically registred by Nuxt.
|
* @see https://v3.nuxtjs.org/guide/features/server-routes
|
||||||
|
*
|
||||||
|
* @note Files from `server/api`, `server/middleware` and `server/routes` will be automatically registered by Nuxt.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* ```js
|
||||||
|
* serverHandlers: [
|
||||||
|
* { route: '/path/foo/**:name', handler: '~/server/foohandler.ts' }
|
||||||
|
* ]
|
||||||
|
* ```
|
||||||
*
|
*
|
||||||
* @type {typeof import('nitropack')['NitroEventHandler'][]}
|
* @type {typeof import('nitropack')['NitroEventHandler'][]}
|
||||||
* @version 3
|
* @version 3
|
||||||
|
Loading…
Reference in New Issue
Block a user