summaryrefslogtreecommitdiffstats
path: root/catalog-ui/webpack.server.js
diff options
context:
space:
mode:
authorandre.schmid <andre.schmid@est.tech>2020-04-21 14:01:21 +0100
committerOfir Sonsino <ofir.sonsino@intl.att.com>2020-04-21 16:53:44 +0000
commitac26dc0d5c5f7fce65e214c31e26e7178e492d5b (patch)
treee8263327d75b0a1fbc87ab1fe44005cbdb8cae84 /catalog-ui/webpack.server.js
parent1b89157b86d89726e294f22416da965a095a2210 (diff)
Fix 404 in sdc-FE calls to workflow
Fixes webpack workflow proxy configuration. Fixes FE proxy while rewriting URLs to workflow plugin. Fixes compilation problems to run locally the catalog-ui. Change-Id: I89f3f46bd8ce0159713b1d0d957a2e75f8a3d062 Issue-ID: SDC-2943 Signed-off-by: andre.schmid <andre.schmid@est.tech>
Diffstat (limited to 'catalog-ui/webpack.server.js')
-rw-r--r--catalog-ui/webpack.server.js31
1 files changed, 8 insertions, 23 deletions
diff --git a/catalog-ui/webpack.server.js b/catalog-ui/webpack.server.js
index 0d43fa1d86..ab8678536c 100644
--- a/catalog-ui/webpack.server.js
+++ b/catalog-ui/webpack.server.js
@@ -5,16 +5,8 @@ const devPort = 9000;
const fePort = 8181;
const feHost = "localhost";
const protocol="http";
-const isDirectToFE = false;
+const isDirectToFE = true;
-/*
-For kubernetes
-const fePort = 30207;
-const wfPort = 30256;
-const feHost = "kubernetes_master";
-const protocol="https";
-const isDirectToFE = true;// whether to proxy to the k8s proxy or to the BE
-*/
const portalCookieValue = "randomValue"; //for dev solely, in production - the webseal would add the cookie by itself.
module.exports = function (env) {
@@ -56,15 +48,11 @@ module.exports = function (env) {
secure: false,
logLevel: 'debug'
}
- if (isDirectToFE) {
- feProxyOptions.pathRewrite= {
- '^/sdc1/feProxy/rest' : '/sdc1/feProxy/rest'
- }
- } else {
- feProxyOptions.pathRewrite= {
- '^/sdc1/feProxy/rest' : '/sdc2/rest'
- }
- }
+ if (!isDirectToFE) {
+ feProxyOptions.pathRewrite= {
+ '^/sdc1/feProxy/rest' : '/sdc2/rest'
+ }
+ }
middlewares.push(
proxy(['/sdc1/feProxy/rest'], feProxyOptions));
@@ -106,14 +94,11 @@ module.exports = function (env) {
// Redirect workflow urls to feHost
middlewares.push(
- proxy(['/sdc1/feProxy/wf', '/wf'], {
- target: protocol + '://' + feHost + ':' + wfPort,
+ proxy(['/wf', '/sdc1/feProxy/wf'], {
+ target: protocol + '://' + feHost + ':' + fePort,
changeOrigin: true,
logLevel: 'debug',
secure: false,
- pathRewrite: {
- '^/sdc1/feProxy' : ''
- },
onProxyRes: (proxyRes, req, res) => {
let setCookie = proxyRes.headers['set-cookie'];
if (setCookie) {