aboutsummaryrefslogtreecommitdiff
path: root/modern/src/setupProxy.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-05-28 13:13:44 -0700
committerAnton Tananaev <anton@traccar.org>2022-05-28 13:13:44 -0700
commit910c8c3a649cb4ad4a405ffb6c2117482d3c4f9d (patch)
treec43507d68643ed3566fc6e07bb1736c92bc909a4 /modern/src/setupProxy.js
parentfe2c3ce2f62486e41273f2caa339ad014e43bf9d (diff)
downloadtrackermap-web-910c8c3a649cb4ad4a405ffb6c2117482d3c4f9d.tar.gz
trackermap-web-910c8c3a649cb4ad4a405ffb6c2117482d3c4f9d.tar.bz2
trackermap-web-910c8c3a649cb4ad4a405ffb6c2117482d3c4f9d.zip
Update react scripts
Diffstat (limited to 'modern/src/setupProxy.js')
-rw-r--r--modern/src/setupProxy.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/modern/src/setupProxy.js b/modern/src/setupProxy.js
index cd6a2faa..be182a51 100644
--- a/modern/src/setupProxy.js
+++ b/modern/src/setupProxy.js
@@ -1,8 +1,8 @@
/* eslint-disable import/no-extraneous-dependencies */
-const proxy = require('http-proxy-middleware');
+const { createProxyMiddleware } = require('http-proxy-middleware');
module.exports = (app) => {
- app.use(proxy('/api/socket', { target: `ws://${process.env.REACT_APP_URL_NAME}`, ws: true }));
- app.use(proxy('/api', { target: `http://${process.env.REACT_APP_URL_NAME}` }));
+ app.use(createProxyMiddleware('/api/socket', { target: `ws://${process.env.REACT_APP_URL_NAME}`, ws: true }));
+ app.use(createProxyMiddleware('/api', { target: `http://${process.env.REACT_APP_URL_NAME}` }));
};