const express = require('express');const app = express();
app.get('/request', (req, res, next) => {//send 响应内容的累心//http 状态码req.name = '张三';next();
})
app.get('/request', (req, res) => {//send 响应内容的累心//http 状态码res.send(req.name);
})
app.listen(3000);
console.log('服务器启动成功');
运行结果