1.npm init -y 初始化 文件
2.利用yarn 安装koa
3.安装node包
4.添加命令 :`{"start":"nodemon app.js"}`

5. 安装koa、koa-router到dependencies
6. 安装nodemon到devDependencies
goods.js
const Router = require('koa-router');
const router = new Router({prefix:'/goods'});
router.get('/', async ctx =>{
ctx.body = '我是商品'
})
router.get('/list', async ctx =>{
ctx.body = '我是商品列表'
})
module.exports = router
<% if(locals.isMe){%>
<a href="#">@提到我(3)</a>
<% } else { %>
<button>关注</button>
<%} %>
npm run start启动服务
1 function stopBubble(e){
2
3 if(e && e.stopPropagation){
4
5 e.stopPropagation();
6 }else{
7
8 window.event.cancelBubble=true;
9 }