Update main.ts
Browse files
main.ts
CHANGED
|
@@ -4,7 +4,11 @@ serve(async (req: Request) => {
|
|
| 4 |
|
| 5 |
let url = new URL(req.url);
|
| 6 |
if (url.pathname == '/' || url.pathname == '') {
|
| 7 |
-
return new Response("", { status:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
}
|
| 9 |
|
| 10 |
let res = await fetch(new Request(url.pathname.substring(1) + url.search,req))
|
|
|
|
| 4 |
|
| 5 |
let url = new URL(req.url);
|
| 6 |
if (url.pathname == '/' || url.pathname == '') {
|
| 7 |
+
return new Response("Not Found", { status: 404 })
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
if (url.pathname == '/ping') {
|
| 11 |
+
return new Response("pong", { status: 200 })
|
| 12 |
}
|
| 13 |
|
| 14 |
let res = await fetch(new Request(url.pathname.substring(1) + url.search,req))
|