diff --git a/.changeset/metal-boxes-compare.md b/.changeset/metal-boxes-compare.md new file mode 100644 index 000000000000..7e9495a07b31 --- /dev/null +++ b/.changeset/metal-boxes-compare.md @@ -0,0 +1,5 @@ +--- +'@astrojs/node': patch +--- + +fix static server path for windows system diff --git a/packages/integrations/node/src/http-server.ts b/packages/integrations/node/src/http-server.ts index 98cde3728320..dd6d10686263 100644 --- a/packages/integrations/node/src/http-server.ts +++ b/packages/integrations/node/src/http-server.ts @@ -16,10 +16,9 @@ export function createServer( ) { const listener: http.RequestListener = (req, res) => { if (req.url) { - const fileURL = new URL('.' + req.url, client); - - const stream = send(req, fileURLToPath(fileURL), { - dotfiles: 'deny', + const stream = send(req, encodeURI(req.url), { + root: fileURLToPath(client), + dotfiles: "deny" }); let forwardError = false;