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))
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…