Skip to content

Commit

Permalink
build(dev-deps): update http-proxy-middleware from v2.0.6 to v3.0.0 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
theborakompanioni authored May 29, 2024
1 parent 3bcbdee commit 407098d
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 32 deletions.
71 changes: 51 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@types/react": "^18.3.2",
"@types/react-dom": "^18.3.0",
"conventional-changelog": "^5.1.0",
"http-proxy-middleware": "^2.0.6",
"http-proxy-middleware": "^3.0.0",
"husky": "^8.0.3",
"jest-watch-typeahead": "^2.2.2",
"jest-websocket-mock": "^2.5.0",
Expand Down
31 changes: 20 additions & 11 deletions src/setupProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ module.exports = (app) => {
* - translate header "x-jm-authorization" to "Authorization"
*/
app.use(
createProxyMiddleware(`${PUBLIC_URL}/jmws`, {
createProxyMiddleware({
pathFilter: `${PUBLIC_URL}/jmws`,
target: `https://127.0.0.1:${JMWALLETD_WEBSOCKET_PORT}`,
pathRewrite: { [`^${PUBLIC_URL}/jmws`]: '' },
changeOrigin: true,
Expand All @@ -41,20 +42,24 @@ module.exports = (app) => {
}),
)
app.use(
createProxyMiddleware(`${PUBLIC_URL}/api/`, {
createProxyMiddleware({
pathFilter: `${PUBLIC_URL}/api/`,
target: `https://127.0.0.1:${JMWALLETD_API_PORT}`,
pathRewrite: { [`^${PUBLIC_URL}`]: '' },
changeOrigin: true,
secure: false,
onProxyReq: (proxyReq, req, res) => {
if (req.headers['x-jm-authorization']) {
proxyReq.setHeader('Authorization', req.headers['x-jm-authorization'])
}
on: {
proxyReq: (proxyReq, req, res) => {
if (req.headers['x-jm-authorization']) {
proxyReq.setHeader('Authorization', req.headers['x-jm-authorization'])
}
},
},
}),
)
app.use(
createProxyMiddleware(`${PUBLIC_URL}/obwatch/`, {
createProxyMiddleware({
pathFilter: `${PUBLIC_URL}/obwatch/`,
target: `http://127.0.0.1:${JMOBWATCH_PORT}`,
pathRewrite: { [`^${PUBLIC_URL}/obwatch/`]: '' },
changeOrigin: true,
Expand All @@ -69,7 +74,8 @@ module.exports = (app) => {
* - proxy all API requests to "Jam API"
*/
app.use(
createProxyMiddleware(`${PUBLIC_URL}/jmws`, {
createProxyMiddleware({
pathFilter: `${PUBLIC_URL}/jmws`,
target: `http://127.0.0.1:${JAM_API_PORT}`,
pathRewrite: { [`^${PUBLIC_URL}`]: '' },
changeOrigin: true,
Expand All @@ -78,23 +84,26 @@ module.exports = (app) => {
}),
)
app.use(
createProxyMiddleware(`${PUBLIC_URL}/api/`, {
createProxyMiddleware({
pathFilter: `${PUBLIC_URL}/api/`,
target: `http://127.0.0.1:${JAM_API_PORT}`,
pathRewrite: { [`^${PUBLIC_URL}`]: '' },
changeOrigin: true,
secure: false,
}),
)
app.use(
createProxyMiddleware(`${PUBLIC_URL}/obwatch/`, {
createProxyMiddleware({
pathFilter: `${PUBLIC_URL}/obwatch/`,
target: `http://127.0.0.1:${JAM_API_PORT}`,
pathRewrite: { [`^${PUBLIC_URL}`]: '' },
changeOrigin: true,
secure: false,
}),
)
app.use(
createProxyMiddleware(`${PUBLIC_URL}/jam/`, {
createProxyMiddleware({
pathFilter: `${PUBLIC_URL}/jam/`,
target: `http://127.0.0.1:${JAM_API_PORT}`,
pathRewrite: { [`^${PUBLIC_URL}`]: '' },
changeOrigin: true,
Expand Down

0 comments on commit 407098d

Please sign in to comment.