mirror of
https://github.com/eyebluecn/tank-front
synced 2024-04-21 12:31:55 +00:00
18 lines
327 B
JavaScript
18 lines
327 B
JavaScript
const proxy = require('http-proxy-middleware');
|
|
|
|
module.exports = function (app) {
|
|
|
|
//为了解决前端开发时跨域问题,配置后台接口代理。
|
|
app.use(proxy(
|
|
'/api',
|
|
{
|
|
target: 'http://localhost:6010',
|
|
changeOrigin: true,
|
|
pathRewrite: {
|
|
'^/api': '/api'
|
|
}
|
|
}
|
|
));
|
|
|
|
};
|