config/dev.env.js //开发环境配置
const merge = require('webpack-merge')
const prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"',
API_ROOT:'"http://127.0.0.1:9092"'
})
config/index.js
const path = require('path')
module.exports = {
dev: {
//设置proxyTable
proxyTable: {
'/api': {
target: 'http://127.0.0.1:9092',
secure:false,
changeOrigin:true,
pathRewrite: {
'^/api': ''
}
}
},
}
http://localhost:8080/api/systemList
http://localhost:9092/systemList