摘要: 1-说明 http express 和 koa 的路由参数分别怎么获取 http: app.get('/add/:name/:age/:sex',function(req,res){ res.send(req.params); }); express: router.get('/student/:i 阅读全文
posted @ 2021-03-07 22:16 雨辰~ 阅读(58) 评论(0) 推荐(0)
摘要: 1-使用 koa 搭建服务器 const koa = require('koa') const app = new koa() // 路由请求 // context 上下文 包含req和res app.use(async (ctx)=>{ ctx.body = 'hello koa2' }) app 阅读全文
posted @ 2021-03-07 22:12 雨辰~ 阅读(56) 评论(0) 推荐(0)