Skip to content

Commit

Permalink
Have rosbridge set domain name based on URL instead of hard-coded (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
amalnanavati authored Nov 21, 2023
1 parent c774e43 commit 6b3e050
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 0 additions & 5 deletions feedingwebapp/.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
# from screens that would otherwise wait for ROS messages).
REACT_APP_DEBUG=false

# The hostname of the ROS server. The app assumes that rosbridge and
# web_video_server are both running on the same hostname. Do not include a
# protocol (e.g., `http://`, `ws://`, etc.) or a port (e.g., `:9090`) in this
# environment variable.
REACT_APP_ROS_SERVER_HOSTNAME="localhost"
# The port of the rosbridge server (default: 9090)
REACT_APP_ROSBRIDGE_PORT="9090"
# The port of the web video server (default: 8080)
Expand Down
4 changes: 2 additions & 2 deletions feedingwebapp/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ function App() {
const appPage = useGlobalState((state) => state.appPage)

// Get the rosbridge URL
const rosbridgeURL = 'ws://'.concat(process.env.REACT_APP_ROS_SERVER_HOSTNAME, ':', process.env.REACT_APP_ROSBRIDGE_PORT)
const rosbridgeURL = 'ws://'.concat(window.location.hostname, ':', process.env.REACT_APP_ROSBRIDGE_PORT)
// Get the web_video_server URL
const webVideoServerURL = 'http://'.concat(process.env.REACT_APP_ROS_SERVER_HOSTNAME, ':', process.env.REACT_APP_WEB_VIDEO_SERVER_PORT)
const webVideoServerURL = 'http://'.concat(window.location.hostname, ':', process.env.REACT_APP_WEB_VIDEO_SERVER_PORT)

// Get the debug flag
const debug = process.env.REACT_APP_DEBUG === 'true'
Expand Down

0 comments on commit 6b3e050

Please sign in to comment.