mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
Prefer import.meta.path in http server guide (#11180)
This commit is contained in:
@@ -18,7 +18,7 @@ const server = Bun.serve({
|
||||
if (path === "/abc") return Response.redirect("/source", 301);
|
||||
|
||||
// send back a file (in this case, *this* file)
|
||||
if (path === "/source") return new Response(Bun.file(import.meta.file));
|
||||
if (path === "/source") return new Response(Bun.file(import.meta.path));
|
||||
|
||||
// respond with JSON
|
||||
if (path === "/api") return Response.json({ some: "buns", for: "you" });
|
||||
|
||||
Reference in New Issue
Block a user