const express = require('express')
const cors = require('cors')
const app=express()
app.use(cors())
app.use(express.static('public'))
app.get('/test',function (req, res) {
console.log("31321")
res.send('77')
}
)
app.listen(3005,function (){console.log("localhost:3005")})
在chrome里请求并打印,结果undefined
fetch('localhost:3005/test').then(res=>console.log(res))
浏览器直接打开 localhost:3005/test 看看有没有数据 或者把send换成render看看