const express = require('express')
const app = express()
const {createProxyMiddleware}=require('http-proxy-middleware')
app.use(express.static('./dist'))
const port = 8080
app.use('/spi',createProxyMiddleware({
target:'http://60.205.183.175:3001',
changeOrigin:true,
pathRewrite: {
"^/spi":""
}
}))
app.listen(port, function () {
console.log('Express server running at http://127.0.0.1:' + port)
})
dist为vue构建后的文件