mirror of
https://github.com/swc-project/swc.git
synced 2024-12-19 03:31:45 +03:00
18 lines
403 B
TypeScript
18 lines
403 B
TypeScript
import { Application, Router } from "./deps.ts";
|
|
|
|
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`);
|
|
await app.listen("0.0.0.0:3000"); |