- 全局安装:npm install express -g
- 引入express
let express = require(‘express‘); let app = express(); app.get(‘/‘,(req,res)=>{ res.send(‘这是首页‘) }) app.listen(8080,()=>{ console.log("服务器启动:","http://localhost:8080") })
2022-09-24 10:36:43
let express = require(‘express‘); let app = express(); app.get(‘/‘,(req,res)=>{ res.send(‘这是首页‘) }) app.listen(8080,()=>{ console.log("服务器启动:","http://localhost:8080") })