Commit 79ca3713 authored by Emiliano Balbuena's avatar Emiliano Balbuena

(chore): Proxy

1 merge request!756Webpack proxy for devs
Pipeline #114961703 failed with stages
in 29 minutes and 28 seconds
......@@ -13,7 +13,7 @@
"serve-dev": "npm run server:ssr",
"build:dev": "ng build --output-path dist --deploy-url=/ --watch=true --poll=800",
"preserve:dev": "npm run prebuild-dev -- --deploy-url=http://${HOST:-localhost}:${PORT:-4200}",
"serve:dev": "ng serve --deploy-url=/ --port ${PORT:-4200} --poll=800 --progress --proxy-config proxy.conf.json --host=0.0.0.0 --disableHostCheck=true",
"serve:dev": "ng serve --deploy-url=/ --port ${PORT:-4200} --poll=800 --progress --proxy-config proxy.conf.js --host=0.0.0.0 --disableHostCheck=true",
"serve:dev:hmr": "npm run serve:dev -- --configuration=hmr --hmr",
"test": "ng test",
"lint": "ng lint",
......
const engineSecure = Boolean(parseInt(process.env['ENGINE_SECURE']) || 0);
const engineHost = process.env['ENGINE_HOST'] || 'localhost';
const enginePort = process.env['ENGINE_PORT'] || (engineSecure ? 443 : 80);
const PROXY_CONFIG = [
{
context: [
'/api',
'/fs',
'/icon',
'/carousel',
],
target: {
protocol: engineSecure ? 'https:' : 'http:',
host: engineHost,
port: enginePort,
},
secure: false,
changeOrigin: true,
withCredentials: true,
logLevel: process.env['PROXY_LOG_LEVEL'] || 'warn',
}
];
module.exports = PROXY_CONFIG;
{
"/api": {
"target": "http://localhost:80",
"secure": false
},
"/fs": {
"target": "http://localhost:80",
"secure": false
},
"/icon": {
"target": "http://localhost:80",
"secure": false
},
"/carousel": {
"target": "http://localhost:80",
"secure": false
}
}
Please register or to comment