摘要:
1-说明 http express 和 koa 的路由参数分别怎么获取 req.params req.query req.body 2-简单说明动态路由 路由器能够自动地建立自己的路由表,并且能够根据实际情况的变化适时地进行调整。 3-说明 express 和 koa 的中间件的使用 // 中间件 阅读全文
posted @ 2021-03-05 15:51
qwerfd
阅读(48)
评论(0)
推荐(0)
摘要:
1-使用 koa 搭建服务器 const koa = require('koa') const app = new koa()// new koa()创建服务 // 路由请求 // context 上下文 包含req和res app.use(async (ctx)=>{ ctx.body = 'he 阅读全文
posted @ 2021-03-05 15:35
qwerfd
阅读(57)
评论(0)
推荐(0)
摘要:
1-使用 express 创建服务器 const express = require('express') const app = express() app.get('/',(req,res)=>{ ... res.send('你好 express') }) app.listen(3000) 2- 阅读全文
posted @ 2021-03-05 15:11
qwerfd
阅读(34)
评论(0)
推荐(0)

浙公网安备 33010602011771号