mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 23:22:02 +00:00
fix(kit): normalize handler paths (#8626)
This commit is contained in:
parent
d8c41e15b1
commit
7c4899a7ab
@ -1,4 +1,5 @@
|
|||||||
import type { NitroEventHandler, NitroDevEventHandler, Nitro } from 'nitropack'
|
import type { NitroEventHandler, NitroDevEventHandler, Nitro } from 'nitropack'
|
||||||
|
import { normalize } from 'pathe'
|
||||||
import { useNuxt } from './context'
|
import { useNuxt } from './context'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -10,7 +11,8 @@ function normalizeHandlerMethod (handler: NitroEventHandler) {
|
|||||||
const [, method = undefined] = handler.handler.match(/\.(get|head|patch|post|put|delete|connect|options|trace)(\.\w+)*$/) || []
|
const [, method = undefined] = handler.handler.match(/\.(get|head|patch|post|put|delete|connect|options|trace)(\.\w+)*$/) || []
|
||||||
return {
|
return {
|
||||||
method,
|
method,
|
||||||
...handler
|
...handler,
|
||||||
|
handler: normalize(handler.handler)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user