Dynamic host
This commit is contained in:
parent
5166c7d0c5
commit
88439ec273
@ -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]),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user