|
@@ -3,8 +3,9 @@ const options: ResponseInit = { headers: { "Server": "Bun" } };
|
|
|
|
|
|
const server = Bun.serve({
|
|
const server = Bun.serve({
|
|
port: 8080,
|
|
port: 8080,
|
|
|
|
+ reusePort: true,
|
|
fetch(req: Request) {
|
|
fetch(req: Request) {
|
|
- const { pathname } = new URL(req.url);
|
|
|
|
|
|
+ const pathname = req.url.slice(req.url.indexOf("/", 8));
|
|
|
|
|
|
if (pathname === "/json") {
|
|
if (pathname === "/json") {
|
|
return Response.json({ message: HELLO_WORLD_STR }, options);
|
|
return Response.json({ message: HELLO_WORLD_STR }, options);
|