From 386908bcba33532d6e102a656164db30d51bcfd3 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Sat, 3 Sep 2022 13:11:13 +0200 Subject: [PATCH 1/2] docs: extend description of server handlers --- packages/schema/src/config/nitro.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/schema/src/config/nitro.ts b/packages/schema/src/config/nitro.ts index 091bee65ae7..f5f9cab2b98 100644 --- a/packages/schema/src/config/nitro.ts +++ b/packages/schema/src/config/nitro.ts @@ -15,9 +15,23 @@ export default defineUntypedSchema({ /** * Nitro server handlers. * - * @see https://nitro.unjs.io/guide/introduction/routing + * Each handler admits 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 kind of requests (`GET`, `POST`, ...) that should be handled. + * - middleware: Specifies this is a middleware handler. + * - lazy: Specifies to use lazy loading to import the handler. + * + * @see https://v3.nuxtjs.org/guide/features/server-routes + * + * @note Files from `server/api`, `server/middleware` and `server/routes` will be automatically registred by Nuxt. * - * **Note:** Files from `server/api`, `server/middleware` and `server/routes` will be automatically registred by Nuxt. + * @example + * ```js + * serverHandlers: [ + * { route: '/path/foo/**:name', handler: '~/server/foohandler.ts' } + * ] + * ``` * * @type {typeof import('nitropack')['NitroEventHandler'][]} * @version 3 From 16ab29324c11895cd65782a7f925b74757260b20 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Sat, 3 Sep 2022 16:19:14 +0200 Subject: [PATCH 2/2] Update packages/schema/src/config/nitro.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Damian Głowala <48835293+DamianGlowala@users.noreply.github.com> --- packages/schema/src/config/nitro.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/schema/src/config/nitro.ts b/packages/schema/src/config/nitro.ts index f5f9cab2b98..dde14944453 100644 --- a/packages/schema/src/config/nitro.ts +++ b/packages/schema/src/config/nitro.ts @@ -15,16 +15,16 @@ export default defineUntypedSchema({ /** * Nitro server handlers. * - * Each handler admits the following options: + * 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 kind of requests (`GET`, `POST`, ...) that should be handled. - * - middleware: Specifies this is a middleware handler. - * - lazy: Specifies to use lazy loading to import the handler. + * - 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. * * @see https://v3.nuxtjs.org/guide/features/server-routes * - * @note Files from `server/api`, `server/middleware` and `server/routes` will be automatically registred by Nuxt. + * @note Files from `server/api`, `server/middleware` and `server/routes` will be automatically registered by Nuxt. * * @example * ```js