import * as Koa from "koa"; import * as Router from "koa-router"; let id = 0; const app = new Koa(); const router = new Router(); router.get("/*", async ctx => { ctx.body = id++; }); app.use(router.routes()); app.listen(3000); console.log("Server running on port 3000");