Skip to content

Commit

Permalink
SERVER-67329 Add proxy middleware to allow react-scripts start
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchwag authored and Evergreen Agent committed Jun 16, 2022
1 parent b4556de commit f4e6ef7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
8 changes: 4 additions & 4 deletions buildscripts/libdeps/graph_visualizer_web_stack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,18 @@
"@material-ui/core": "5.0.0-alpha.22",
"@material-ui/icons": "5.0.0-alpha.22",
"@material-ui/lab": "5.0.0-alpha.22",
"bezier-js": "4.0.3",
"canvas": "^2.5.0",
"date-fns": "^2.16.1",
"dayjs": "^1.9.7",
"force-graph": "1.40.0",
"http-proxy-middleware": "^2.0.6",
"http-server": "^0.12.3",
"luxon": "^1.25.0",
"moment": "^2.29.1",
"p-limit": "^3.0.2",
"react": "^16.8",
"react-dom": "^16.0.0",
"bezier-js": "4.0.3",
"force-graph": "1.40.0",
"react-force-graph-2d": "1.18.1",
"react-force-graph-3d": "1.18.8",
"react-indiana-drag-scroll": "^1.8.0",
Expand All @@ -56,6 +57,5 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"proxy": "http://localhost:5000"
}
}
17 changes: 17 additions & 0 deletions buildscripts/libdeps/graph_visualizer_web_stack/src/setupProxy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* This proxy is intended to allow the visualizer to run in a development environment
* which includes SSH tunnels communicating with private remote hosts.
*/

const { createProxyMiddleware } = require('http-proxy-middleware');

module.exports = function(app) {
app.use(
createProxyMiddleware('/socket.io', {
target: 'http://localhost:5000',
ws: true,
changeOrigin: true,
secure: false
})
);
};

0 comments on commit f4e6ef7

Please sign in to comment.