aboutsummaryrefslogtreecommitdiff
path: root/examples/http-file.ts
diff options
context:
space:
mode:
Diffstat (limited to 'examples/http-file.ts')
-rw-r--r--examples/http-file.ts4
1 files changed, 1 insertions, 3 deletions
diff --git a/examples/http-file.ts b/examples/http-file.ts
index f2c0773e8..3c1d67169 100644
--- a/examples/http-file.ts
+++ b/examples/http-file.ts
@@ -1,9 +1,7 @@
// Start a fast HTTP server from a function
Bun.serve({
fetch(req) {
- const url = new URL(req.url.substring(1), "file://" + import.meta.path);
- const path = Bun.resolveSync(url.pathname, import.meta.path);
- return new Response(Bun.file(path));
+ return new Response("Hello World!");
},
// this is called when fetch() throws or rejects