Skip to content

Commit

Permalink
fix: avoid empty scaned route (resolves unjs#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 authored and WinterYukky committed Nov 1, 2022
1 parent 3c09d77 commit 1e174ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/scan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function scanRoutes (nitro: Nitro, dir: string, prefix: string = '/') {
method = methodMatch[1]
}

route = route.replace(/\/index$/, '')
route = route.replace(/\/index$/, '') || '/'

return {
handler: file.fullPath,
Expand Down

0 comments on commit 1e174ff

Please sign in to comment.