Skip to content

Commit cffe915

Browse files
authored
chore: upgrade http-proxy-middleware (#616)
1 parent f1540c0 commit cffe915

File tree

3 files changed

+34
-15
lines changed

3 files changed

+34
-15
lines changed

package-lock.json

Lines changed: 20 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"dotenv-cli": "4.1.1",
3434
"framer-motion": "^6.2.9",
3535
"generate-download-link": "1.0.1",
36-
"http-proxy-middleware": "0.21.0",
36+
"http-proxy-middleware": "3.0.5",
3737
"i18next": "19.9.2",
3838
"i18next-browser-languagedetector": "6.1.4",
3939
"i18next-http-backend": "3.0.2",

src/setupProxy.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,28 @@
1-
const proxy = require('http-proxy-middleware')
1+
const { createProxyMiddleware } = require('http-proxy-middleware')
22

33
module.exports = function (app) {
44
app.use(
5-
proxy('/api/ws', {
5+
'/api/ws',
6+
createProxyMiddleware({
67
target: 'ws://localhost:8080',
78
ws: true,
89
changeOrigin: true,
910
logLevel: 'debug',
1011
pathRewrite: { '^/api/ws': '/ws' },
1112
}),
12-
proxy('/api', {
13+
)
14+
15+
app.use(
16+
'/api',
17+
createProxyMiddleware({
1318
target: 'http://localhost:8080',
1419
pathRewrite: { '^/api/': '/' },
1520
}),
16-
proxy('/trans', {
21+
)
22+
23+
app.use(
24+
'/trans',
25+
createProxyMiddleware({
1726
target: 'http://localhost:3333',
1827
}),
1928
)

0 commit comments

Comments
 (0)