mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
Update http-file.ts
This commit is contained in:
@@ -2,11 +2,7 @@ const { serve, file, resolveSync } = Bun;
|
||||
const { path } = import.meta;
|
||||
serve({
|
||||
fetch(req: Request) {
|
||||
const modulePath = resolveSync(
|
||||
new URL(req.url).pathname.substring(1),
|
||||
path
|
||||
);
|
||||
return new Response(file(modulePath));
|
||||
return new Response(file(new URL(req.url).pathname.substring(1)));
|
||||
},
|
||||
|
||||
// this is called when fetch() throws or rejects
|
||||
|
||||
Reference in New Issue
Block a user