datasurvey/webpack/proxy.conf.js

30 lines
561 B
JavaScript
Raw Normal View History

2021-07-03 21:48:27 +00:00
function setupProxy() {
const tls = process.env.TLS;
const conf = [
{
context: [
'/api',
'/services',
'/management',
'/swagger-resources',
'/v2/api-docs',
'/v3/api-docs',
'/h2-console',
'/auth',
'/health',
],
target: `http${tls ? 's' : ''}://localhost:8080`,
secure: false,
changeOrigin: tls,
},
{
context: ['/websocket'],
target: 'ws://127.0.0.1:8080',
ws: true,
},
];
return conf;
}
module.exports = setupProxy();