Skip to content

Commit

Permalink
Merge pull request #133 from nobkd/patch-1
Browse files Browse the repository at this point in the history
fix(nuekit-server): allow resolving index.html with base url
  • Loading branch information
tipiirai authored Jan 3, 2024
2 parents 0be1f4e + c2e1150 commit 6c6b00b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/nuekit/src/nueserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ export function createServer(root, callback) {
})
}

const [ url, _ ] = req.url.split('?')
let [ url, _ ] = req.url.split('?')
const ext = extname(url).slice(1)

if (!ext) url = join(url, 'index.html')

try {
const { code, path } = !ext || ext == 'html' ? await callback(url, _) : { path: url }
if (!path) throw { errno: -2 }
Expand Down

0 comments on commit 6c6b00b

Please sign in to comment.