Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
fix(kit): normalize handler paths
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Nov 2, 2022
1 parent 491d02f commit 285d3db
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/kit/src/nitro.ts
@@ -1,4 +1,5 @@
import type { NitroEventHandler, NitroDevEventHandler, Nitro } from 'nitropack'
import { normalize } from 'pathe'
import { useNuxt } from './context'

/**
Expand All @@ -10,7 +11,8 @@ function normalizeHandlerMethod (handler: NitroEventHandler) {
const [, method = undefined] = handler.handler.match(/\.(get|head|patch|post|put|delete|connect|options|trace)(\.\w+)*$/) || []
return {
method,
...handler
...handler,
handler: normalize(handler.handler)
}
}

Expand Down

0 comments on commit 285d3db

Please sign in to comment.