mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-09 17:29:50 +03:00
quick proxy test
This commit is contained in:
@@ -1,11 +1,7 @@
|
||||
# Change the IP address to that of your ESP device to enable local development of the UI.
|
||||
# Remember to also enable CORS in platformio.ini before uploading the code to the device
|
||||
# with -DENABLE_CORS
|
||||
# Change the IP address to that of your ESP device to enable local development of the UI
|
||||
|
||||
# my Wifi
|
||||
#REACT_APP_HTTP_ROOT=http://10.10.10.101
|
||||
#REACT_APP_WEB_SOCKET_ROOT=ws://10.10.10.101
|
||||
REACT_APP_HTTP_ROOT=http://localhost:3000
|
||||
|
||||
# my Ethernet
|
||||
REACT_APP_HTTP_ROOT=http://192.168.1.134
|
||||
REACT_APP_WEB_SOCKET_ROOT=ws://http://192.168.1.134
|
||||
# REACT_APP_HTTP_ROOT=http://172.17.233.73:3000
|
||||
|
||||
# REACT_APP_WEB_SOCKET_ROOT=ws://localhost:3000
|
||||
|
||||
1
interface/package-lock.json
generated
1
interface/package-lock.json
generated
@@ -36,6 +36,7 @@
|
||||
"zlib": "^1.0.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"http-proxy-middleware": "^0.19.1",
|
||||
"react-app-rewired": "^2.1.8"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -51,6 +51,8 @@
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"react-app-rewired": "^2.1.8"
|
||||
"http-proxy-middleware": "^0.19.1",
|
||||
"react-app-rewired": "^2.1.8",
|
||||
"concurrently": "^4.1.0"
|
||||
}
|
||||
}
|
||||
|
||||
15
interface/src/setupProxy.js
Normal file
15
interface/src/setupProxy.js
Normal file
@@ -0,0 +1,15 @@
|
||||
const createProxyMiddleware = require('http-proxy-middleware');
|
||||
|
||||
module.exports = function (app) {
|
||||
app.use(
|
||||
'/rest/*',
|
||||
createProxyMiddleware({
|
||||
target: 'http://localhost:3080',
|
||||
secure: false,
|
||||
changeOrigin: true,
|
||||
// pathRewrite: {
|
||||
// '^/api/settings': '/api/app/settings'
|
||||
// },
|
||||
})
|
||||
);
|
||||
};
|
||||
11
interface/x
Normal file
11
interface/x
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
> esp8266-react@0.1.0 start
|
||||
> react-app-rewired start
|
||||
|
||||
[HPM] Proxy created: / -> http://localhost:3080
|
||||
[34mℹ[39m [90m「wds」[39m: Project is running at http://172.17.233.73/
|
||||
[34mℹ[39m [90m「wds」[39m: webpack output is served from
|
||||
[34mℹ[39m [90m「wds」[39m: Content not from webpack is served from /home/paul/dev/EMS-ESP32/interface/public
|
||||
[34mℹ[39m [90m「wds」[39m: 404s will fallback to /
|
||||
Starting the development server...
|
||||
|
||||
Reference in New Issue
Block a user