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