mirror of
https://github.com/alextselegidis/plainpad.git
synced 2024-09-19 06:37:28 +03:00
Create a UI proxy setup
This commit is contained in:
parent
547174e037
commit
c14f5a3528
@ -2,3 +2,4 @@ PORT=3000
|
||||
CHOKIDAR_USEPOLLING=true
|
||||
REACT_APP_BASE_URL=api.php
|
||||
REACT_APP_VERSION=1.0.0-beta.4
|
||||
REACT_APP_PROXY_HOST=http://localhost:8080
|
||||
|
11
client/src/setupProxy.js
Normal file
11
client/src/setupProxy.js
Normal file
@ -0,0 +1,11 @@
|
||||
const createProxyMiddleware = require('http-proxy-middleware');
|
||||
|
||||
module.exports = function(app) {
|
||||
app.use(
|
||||
process.env.REACT_APP_BASE_URL, // You can pass in an array too eg. ['/api', '/another/path']
|
||||
createProxyMiddleware({
|
||||
target: process.env.REACT_APP_PROXY_HOST,
|
||||
changeOrigin: true,
|
||||
})
|
||||
);
|
||||
};
|
Loading…
Reference in New Issue
Block a user