From 4dee9be3eb8668dae4ec26308c4480fa0b59132c Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Sun, 8 May 2022 01:13:03 -0700 Subject: Update http-file.ts --- examples/http-file.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'examples/http-file.ts') diff --git a/examples/http-file.ts b/examples/http-file.ts index 4eaa03212..2789f09a1 100644 --- a/examples/http-file.ts +++ b/examples/http-file.ts @@ -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 -- cgit v1.2.3