20 lines
365 B
TypeScript
20 lines
365 B
TypeScript
|
import { Application, Router } from "https://deno.land/x/oak@v12.6.1/mod.ts";
|
||
|
|
||
|
const port = 8000;
|
||
|
|
||
|
const app = new Application();
|
||
|
|
||
|
const router = new Router();
|
||
|
|
||
|
app.use((ctx) => {
|
||
|
return ctx.send({
|
||
|
root: "public",
|
||
|
index: "index.html",
|
||
|
});
|
||
|
});
|
||
|
|
||
|
app.use(router.routes());
|
||
|
|
||
|
console.log(`Listening on port ${port}`);
|
||
|
await app.listen({ port });
|