basic server

This commit is contained in:
Ruidy 2021-02-19 16:27:55 +01:00
parent 7f0e54b29d
commit 78d7597c76
2 changed files with 9 additions and 0 deletions

View file

@ -1,5 +1,8 @@
.PHONY: cli
cli:
deno run cli.ts
.PHONY: run
run:
deno run --allow-net server.ts
tests:
deno test --coverage --unstable

6
server.ts Normal file
View file

@ -0,0 +1,6 @@
import { listenAndServe } from "https://deno.land/std@0.87.0/http/server.ts";
const port = 8000;
console.log(`Server listening on http://localhost:${port}/`);
await listenAndServe({ port }, (req) => req.respond({ body: "Hello" }));