aboutsummaryrefslogtreecommitdiff
path: root/modern/src/setupProxy.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-03-21 17:51:49 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-03-21 17:51:49 -0700
commit69a38ffe392ca4bae7daf82a50c9b9d2166fae28 (patch)
tree1ffc3f380c6cbae858dd6819a03cbd39cdd78a25 /modern/src/setupProxy.js
parent95cbf0277936012c01e46c2a3625d5bdeebb48ae (diff)
downloadtrackermap-web-69a38ffe392ca4bae7daf82a50c9b9d2166fae28.tar.gz
trackermap-web-69a38ffe392ca4bae7daf82a50c9b9d2166fae28.tar.bz2
trackermap-web-69a38ffe392ca4bae7daf82a50c9b9d2166fae28.zip
Fix websocket proxy
Diffstat (limited to 'modern/src/setupProxy.js')
-rw-r--r--modern/src/setupProxy.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/modern/src/setupProxy.js b/modern/src/setupProxy.js
new file mode 100644
index 00000000..71312d50
--- /dev/null
+++ b/modern/src/setupProxy.js
@@ -0,0 +1,6 @@
+const proxy = require('http-proxy-middleware');
+
+module.exports = function(app) {
+ app.use(proxy('/api/socket', { target: 'ws://localhost:8082', ws: true }));
+ app.use(proxy('/api', { target: 'http://localhost:8082' }));
+};