2022-08-26 15:47:29 +00:00
|
|
|
import { defineUntypedSchema } from 'untyped'
|
|
|
|
|
|
|
|
export default defineUntypedSchema({
|
2022-02-10 17:29:59 +00:00
|
|
|
/**
|
2022-08-11 21:25:35 +00:00
|
|
|
* Configuration for Nitro.
|
2022-04-01 13:02:26 +00:00
|
|
|
*
|
2022-05-06 13:31:52 +00:00
|
|
|
* @see https://nitro.unjs.io/config/
|
2022-04-07 12:57:57 +00:00
|
|
|
*
|
|
|
|
* @type {typeof import('nitropack')['NitroConfig']}
|
2022-04-01 13:02:26 +00:00
|
|
|
* @version 2
|
|
|
|
* @version 3
|
2022-08-11 21:25:35 +00:00
|
|
|
*/
|
2022-10-17 11:22:30 +00:00
|
|
|
nitro: {
|
|
|
|
routes: {
|
|
|
|
$resolve: async (val, get) => ({
|
|
|
|
...await get('routeRules') || {},
|
|
|
|
...val || {}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Global route options applied to matching server routes.
|
|
|
|
*
|
|
|
|
* @experimental This is an experimental feature and API may change in the future.
|
|
|
|
*
|
|
|
|
* @see https://nitro.unjs.io/config/#routes
|
|
|
|
*
|
|
|
|
* @type {typeof import('nitropack')['NitroConfig']['routes']}
|
|
|
|
* @version 3
|
|
|
|
*/
|
|
|
|
routeRules: {},
|
2022-05-06 13:31:52 +00:00
|
|
|
|
|
|
|
/**
|
2022-08-11 21:25:35 +00:00
|
|
|
* Nitro server handlers.
|
2022-05-06 13:31:52 +00:00
|
|
|
*
|
2022-09-05 07:33:07 +00:00
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* @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.
|
2022-05-06 13:31:52 +00:00
|
|
|
*
|
2022-09-05 07:33:07 +00:00
|
|
|
* @example
|
|
|
|
* ```js
|
|
|
|
* serverHandlers: [
|
|
|
|
* { route: '/path/foo/**:name', handler: '~/server/foohandler.ts' }
|
|
|
|
* ]
|
|
|
|
* ```
|
2022-05-06 13:31:52 +00:00
|
|
|
*
|
|
|
|
* @type {typeof import('nitropack')['NitroEventHandler'][]}
|
|
|
|
* @version 3
|
|
|
|
*/
|
|
|
|
serverHandlers: [],
|
|
|
|
|
|
|
|
/**
|
2022-08-11 21:25:35 +00:00
|
|
|
* Nitro development-only server handlers.
|
2022-05-06 13:31:52 +00:00
|
|
|
*
|
2022-08-16 17:29:46 +00:00
|
|
|
* @see https://nitro.unjs.io/guide/introduction/routing
|
2022-05-06 13:31:52 +00:00
|
|
|
*
|
|
|
|
* @type {typeof import('nitropack')['NitroDevEventHandler'][]}
|
|
|
|
* @version 3
|
|
|
|
*/
|
2022-08-11 21:25:35 +00:00
|
|
|
devServerHandlers: []
|
2022-08-26 15:47:29 +00:00
|
|
|
})
|