deno.land / x / denon@2.5.0 / examples / oak.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { Application } from "https://deno.land/x/oak/mod.ts";import { green } from "https://deno.land/std/fmt/colors.ts";
const app = new Application();
const PORT = 8000;
const port = Deno.env.get("PORT");if (port) { PORT = Number.parseInt(port);}
app.use((ctx) => { ctx.response.body = "Hello Denon!";});
console.log("Webserver listening to", green(`:${PORT}`));
await app.listen({ port: PORT });
denon

Version Info

Tagged at
2 years ago

External Dependencies

No external dependencies 🎉