diff options
author | 2022-05-08 01:13:03 -0700 | |
---|---|---|
committer | 2022-05-08 01:13:03 -0700 | |
commit | 4dee9be3eb8668dae4ec26308c4480fa0b59132c (patch) | |
tree | 793ae6443f38beb7dbf36758113f877ee922c02d | |
parent | 61afb8955c21bf4e8fee786595adae425eef6231 (diff) | |
download | bun-4dee9be3eb8668dae4ec26308c4480fa0b59132c.tar.gz bun-4dee9be3eb8668dae4ec26308c4480fa0b59132c.tar.zst bun-4dee9be3eb8668dae4ec26308c4480fa0b59132c.zip |
Update http-file.ts
-rw-r--r-- | examples/http-file.ts | 6 |
1 files changed, 1 insertions, 5 deletions
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 |