diff --git a/src/App.tsx b/src/App.tsx index 03446a2..2577536 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -26,9 +26,11 @@ const App = (): React.ReactElement => { modifiers: ['sidebarExtended'], }; + const host = window.location.hostname; + const echoClient = new Echo({ broadcaster: 'socket.io', - host: 'http://localhost:6001', + host: `http://${host}:6001`, client: io, auth: { headers: { @@ -37,7 +39,7 @@ const App = (): React.ReactElement => { }, }); const echoLink = new EchoLink(echoClient); - const httpLink = new HttpLink({ uri: 'http://localhost/graphql/' }); + const httpLink = new HttpLink({ uri: `http://${host}/graphql/` }); const client = new ApolloClient({ link: ApolloLink.from([echoLink, httpLink]),