路由
安装依赖
cnpm install koa-router --save
修改index.js
const koa = require('koa');
const router = require('koa-router')();
const app = new koa();
router.get('/',async(ctx,next) => {
ctx.response.body = "<h1>hello,world</h1>"
})
app.use(router.routes());
app.listen(3000);
console.log(`app start at localhost:3000`);

别的页面
const koa = require('koa');
const router = require('koa-router')();
const app = new koa();
router.get('/',async(ctx,next) => {
ctx.response.body = "<h1>hello,world</h1>"
})
router.get('/hello',async(ctx,next) => {
ctx.response.body = "this is hello page"
})
router.get('/hello/:name',async(ctx,next) => {
var name = ctx.params.name;
ctx.response.body = `<h1>hello,${name}</h1>`
})
app.use(router.routes());
app.listen(3000);
console.log(`app start at localhost:3000`);


post
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。