2022-05-04 17:25:28 +03:00
|
|
|
import {
|
|
|
|
Application,
|
|
|
|
Router,
|
|
|
|
} from "https://raw.githubusercontent.com/kdy1/oak-bundle-issue/master/deps.ts";
|
2020-11-30 12:21:34 +03:00
|
|
|
|
|
|
|
const app = new Application();
|
|
|
|
const router = new Router();
|
|
|
|
|
|
|
|
router.get("/", (ctx) => {
|
|
|
|
ctx.response.body = "Index Page";
|
|
|
|
});
|
|
|
|
|
|
|
|
router.get("/users", (ctx) => {
|
|
|
|
ctx.response.body = "Users Page";
|
|
|
|
});
|
|
|
|
|
|
|
|
app.use(router.routes());
|
|
|
|
app.use(router.allowedMethods());
|
|
|
|
|
|
|
|
console.log(`Now listening on http://0.0.0.0:3000`);
|
2020-12-27 13:02:41 +03:00
|
|
|
setTimeout(() => {
|
|
|
|
Deno.exit(0);
|
2022-05-04 17:25:28 +03:00
|
|
|
}, 1000);
|
|
|
|
await app.listen("0.0.0.0:58545");
|