fix: build error due react-router-dom
This commit is contained in:
parent
63d502fce1
commit
dcb52aa0de
|
@ -2,14 +2,7 @@
|
|||
"name": "golang-url-shortener",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"proxy": {
|
||||
"/api": {
|
||||
"target": "http://127.0.0.1:8080"
|
||||
},
|
||||
"/d": {
|
||||
"target": "http://127.0.0.1:8080"
|
||||
}
|
||||
},
|
||||
"proxy": "http://127.0.0.1:8080",
|
||||
"dependencies": {
|
||||
"moment": "2.24.0",
|
||||
"prismjs": "1.15.0",
|
||||
|
@ -35,13 +28,13 @@
|
|||
"test": "react-scripts test --env=jsdom",
|
||||
"eject": "react-scripts eject"
|
||||
},
|
||||
"resolutions": {
|
||||
"react-router": "4.3.1"
|
||||
},
|
||||
"browserslist": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not ie <= 11",
|
||||
"not op_mini all"
|
||||
]
|
||||
],
|
||||
"devDependencies": {
|
||||
"http-proxy-middleware": "^0.19.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
const proxy = require('http-proxy-middleware')
|
||||
const pkg = require("../package.json")
|
||||
|
||||
module.exports = app => {
|
||||
app.use(proxy('/api', {
|
||||
target: pkg.proxy
|
||||
}))
|
||||
|
||||
app.use(proxy('/d', {
|
||||
target: pkg.proxy
|
||||
}))
|
||||
}
|
Loading…
Reference in New Issue