Dynamic host
This commit is contained in:
+4
-2
@@ -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]),
|
||||
|
||||
Reference in New Issue
Block a user