1. const koa = require("koa");
    2. const app = new koa();
    3. const router = require("koa-router")();
    4. router.get("/",async ctx=>{
    5. ctx.body = {
    6. code:200,
    7. msg:"hello"
    8. }
    9. })
    10. app.use(router.routes())
    11. app.listen(8080);