Skip to content

Commit

Permalink
chore: make the api and rpc endpoints dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
rabi-siddique committed Jul 8, 2024
1 parent cbc1754 commit 611e29d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions ui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ import '@agoric/react-components/dist/style.css';

function App() {
const { themeClass } = useTheme();
let REST_HOSTNAME = 'http://localhost:1317'
let RPC_HOSTNAME = 'http://localhost:26657'
if (import.meta.env.VITE_HOSTNAME ) {
REST_HOSTNAME = `https://solid-enigma-4vjj94wjqrxc7xrg-1317.app.github.dev/`;
RPC_HOSTNAME = `https://solid-enigma-4vjj94wjqrxc7xrg-26657.app.github.dev/`;
let REST_HOSTNAME = 'http://localhost:1317';
let RPC_HOSTNAME = 'http://localhost:26657';

let codeSpaceHostName = import.meta.env.VITE_HOSTNAME;

Check failure on line 14 in ui/src/App.tsx

View workflow job for this annotation

GitHub Actions / unit

'codeSpaceHostName' is never reassigned. Use 'const' instead

if (codeSpaceHostName) {
REST_HOSTNAME = `https://${codeSpaceHostName}-1317.app.github.dev/`;
RPC_HOSTNAME = `https://${codeSpaceHostName}-26657.app.github.dev/`;
}

return (
Expand Down

0 comments on commit 611e29d

Please sign in to comment.