mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
fix(ui): 🐛 workaround cra proxy bug
ref https://github.com/facebook/create-react-app/issues/11762\#issuecomment-1001295074
This commit is contained in:
parent
4a2a4272ba
commit
8cd6889be1
3 changed files with 12 additions and 1 deletions
BIN
web/package-lock.json
generated
BIN
web/package-lock.json
generated
Binary file not shown.
|
|
@ -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",
|
||||
|
|
@ -34,7 +35,6 @@
|
|||
"test": "react-app-rewired test",
|
||||
"eject": "react-scripts eject"
|
||||
},
|
||||
"proxy": "http://localhost:8080",
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"react-app",
|
||||
|
|
|
|||
11
web/src/setupProxy.js
Normal file
11
web/src/setupProxy.js
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
const { createProxyMiddleware } = require("http-proxy-middleware");
|
||||
|
||||
module.exports = function (app) {
|
||||
app.use(
|
||||
"/api",
|
||||
createProxyMiddleware({
|
||||
target: "http://localhost:8080",
|
||||
changeOrigin: true,
|
||||
})
|
||||
);
|
||||
};
|
||||
Loading…
Reference in a new issue