ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
路由另一种写法 ~~~ const Koa =require('koa'); const router =require('koa-router')(); let app = new Koa(); router.get('/' ,async (ctx)=>{ ctx.body='你好 koa'; }); router.get('/news' ,async (ctx)=>{ ctx.body='你好 news'; }); router.get('/index' ,async (ctx)=>{ ctx.body='你好 index'; }); app.use(router.routes()); app.use(router.allowedMethods()); app.listen(8000); ~~~