deno.land / x / diplodocus@0.0.3 / server.ts

server.ts
View Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/// <reference path="./_deploy.d.ts" />
import { Diplodocus } from "./mod.ts";
const diplodocus = await Diplodocus.load();
const port = 8080;const listener = Deno.listen({ port });if (!Deno.env.get("DENO_DEPLOYMENT_ID")) { console.log(`HTTP server listening on http://localhost:${port}`);}
async function handleConn(conn: Deno.Conn) { const httpConn = Deno.serveHttp(conn); for await (const e of httpConn) { e.respondWith(diplodocus.handler(e.request)); }}
for await (const conn of listener) { handleConn(conn);}
diplodocus
🦕 Deno Deploy Docs 📓
DocumentationDocumentation
GitHub Stars
21

Version Info

Tagged at
7 months ago