diff --git a/src/runtime/virtual/server-handlers.d.ts b/src/runtime/virtual/server-handlers.d.ts index 2eb34d67b7..00f95097aa 100644 --- a/src/runtime/virtual/server-handlers.d.ts +++ b/src/runtime/virtual/server-handlers.d.ts @@ -1,10 +1,10 @@ -import type { CompatibilityEventHandler } from 'h3' +import type { CompatibilityEventHandler, RouterMethod } from 'h3' interface HandlerDefinition { route: string lazy?: boolean handler: CompatibilityEventHandler | (() => Promise) - method?: 'connect'| 'delete'| 'get'| 'head'| 'options'| 'post'| 'put'| 'trace' + method?: RouterMethod } export const handlers: HandlerDefinition[] diff --git a/src/scan.ts b/src/scan.ts index 6cc792e1dc..4d3ff03145 100644 --- a/src/scan.ts +++ b/src/scan.ts @@ -7,7 +7,7 @@ import type { Nitro, NitroEventHandler } from './types' export const GLOB_SCAN_PATTERN = '**/*.{ts,mjs,js,cjs}' type FileInfo = { dir: string, path: string, fullPath: string } -const httpMethodRegex = /\.(connect|delete|get|head|options|post|put|trace)/ +const httpMethodRegex = /\.(connect|delete|get|head|options|patch|post|put|trace)/ export async function scanHandlers (nitro: Nitro) { const handlers = await Promise.all([