Skip to content

Commit

Permalink
fix(ui): 🐛 workaround cra proxy bug
Browse files Browse the repository at this point in the history
  • Loading branch information
collinbarrett committed Jan 22, 2022
1 parent fe9eeba commit 3137aa2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions web/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 web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"customize-cra": "^1.0.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"http-proxy-middleware": "^2.0.1",
"less": "^4.1.2",
"less-loader": "^7.3.0",
"prettier": "^2.5.1",
Expand All @@ -34,7 +35,6 @@
"test": "react-app-rewired test",
"eject": "react-scripts eject"
},
"proxy": "http://localhost:8080",
"eslintConfig": {
"extends": [
"react-app",
Expand Down
11 changes: 11 additions & 0 deletions web/src/setupProxy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const { createProxyMiddleware } = require("http-proxy-middleware");

module.exports = function (app) {
app.use(
"/api",
createProxyMiddleware({
target: "http://localhost:8080",
changeOrigin: true,
})
);
};

0 comments on commit 3137aa2

Please sign in to comment.