SatCat commited on
Commit
4564fd2
·
verified ·
1 Parent(s): d053f1e

Create main.ts

Browse files
Files changed (1) hide show
  1. main.ts +10 -0
main.ts ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ import { serve } from "https://deno.land/std@0.77.0/http/server.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
+ }