Skip to content

Commit 27b2786

Browse files
committed
Fix proxy-middleware
PR [weaveworks#4413](weaveworks#4413) moved the proxy-middleware across major versions without migrations being applied to `.proxyrc.js` This affects redirecting API traffic from the front end to the backend server for both the `/v1` and `/oauth2` endpoints. This commit resolves that break by applying the necessary migration to `.proxyrc.js`
1 parent 6ce868e commit 27b2786

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

.proxyrc.js

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,14 @@ const proxyHost = process.env.PROXY_HOST || DEFAULT_PROXY_HOST;
88
const secure = process.env.PROXY_SECURE === "true";
99

1010
module.exports = function (app) {
11-
app.use(
12-
"/v1",
13-
createProxyMiddleware({
14-
target: proxyHost,
15-
secure,
16-
changeOrigin: true,
17-
})
18-
);
19-
app.use(
20-
"/oauth2",
21-
createProxyMiddleware({
22-
target: proxyHost,
23-
secure,
24-
changeOrigin: true,
25-
})
26-
);
11+
app.use("/v1", createProxyMiddleware({
12+
target: proxyHost + "/v1",
13+
secure,
14+
changeOrigin: true,
15+
}));
16+
app.use("/oauth2", createProxyMiddleware({
17+
target: proxyHost + "/oauth2",
18+
secure,
19+
changeOrigin: true,
20+
}));
2721
};

0 commit comments

Comments
 (0)