SatCat commited on
Commit
c271176
·
verified ·
1 Parent(s): 14a1f41

Update main.ts

Browse files
Files changed (1) hide show
  1. main.ts +4 -6
main.ts CHANGED
@@ -1,10 +1,8 @@
1
  import { serve } from "./deps.ts";
2
 
3
- const PORT = 8000;
4
- const s = serve(`0.0.0.0:${PORT}`);
5
- const body = new TextEncoder().encode("Hello World\n");
6
 
7
  console.log(`Server started on port ${PORT}`);
8
- for await (const req of s) {
9
- req.respond({ body });
10
- }
 
 
1
  import { serve } from "./deps.ts";
2
 
 
 
 
3
 
4
  console.log(`Server started on port ${PORT}`);
5
+ Deno.serve(
6
+ { port: 8000, hostname: "0.0.0.0" },
7
+ (_req) => new Response("Hello, world from Deno")
8
+ );