Skip to content

Commit 6b3e050

Browse files
authored
Have rosbridge set domain name based on URL instead of hard-coded (#100)
1 parent c774e43 commit 6b3e050

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

feedingwebapp/.env

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
# from screens that would otherwise wait for ROS messages).
33
REACT_APP_DEBUG=false
44

5-
# The hostname of the ROS server. The app assumes that rosbridge and
6-
# web_video_server are both running on the same hostname. Do not include a
7-
# protocol (e.g., `http://`, `ws://`, etc.) or a port (e.g., `:9090`) in this
8-
# environment variable.
9-
REACT_APP_ROS_SERVER_HOSTNAME="localhost"
105
# The port of the rosbridge server (default: 9090)
116
REACT_APP_ROSBRIDGE_PORT="9090"
127
# The port of the web video server (default: 8080)

feedingwebapp/src/App.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ function App() {
5656
const appPage = useGlobalState((state) => state.appPage)
5757

5858
// Get the rosbridge URL
59-
const rosbridgeURL = 'ws://'.concat(process.env.REACT_APP_ROS_SERVER_HOSTNAME, ':', process.env.REACT_APP_ROSBRIDGE_PORT)
59+
const rosbridgeURL = 'ws://'.concat(window.location.hostname, ':', process.env.REACT_APP_ROSBRIDGE_PORT)
6060
// Get the web_video_server URL
61-
const webVideoServerURL = 'http://'.concat(process.env.REACT_APP_ROS_SERVER_HOSTNAME, ':', process.env.REACT_APP_WEB_VIDEO_SERVER_PORT)
61+
const webVideoServerURL = 'http://'.concat(window.location.hostname, ':', process.env.REACT_APP_WEB_VIDEO_SERVER_PORT)
6262

6363
// Get the debug flag
6464
const debug = process.env.REACT_APP_DEBUG === 'true'

0 commit comments

Comments
 (0)