const http = require('http');
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
app.use(bodyParser.urlencoded({extended: false}));
app.use('add-product', (req, res, next) => {
res.send('<div>aaaa</div>');
})
app.use('/', (req, res, next) => {
res.send('<div>bbbbb</div>');
})
const server = http.createServer(app);
server.listen(3000);
node中间件简易使用
最新推荐文章于 2022-12-31 17:37:04 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)