Url fix
This commit is contained in:
parent
c3859b4bea
commit
078ee42f51
@ -11,13 +11,20 @@ const root = ReactDOM.createRoot(
|
|||||||
document.getElementById('root') as HTMLElement
|
document.getElementById('root') as HTMLElement
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
const wsUrl = () => {
|
||||||
const protocol = window.location.protocol;
|
const protocol = window.location.protocol;
|
||||||
const host = window.location.host;
|
const host = window.location.host;
|
||||||
const wsUrl = "http://localhost:8080/ws" //`${protocol}//${host}/ws`;
|
if (window.location.href.startsWith("http://localhost:3000")) {
|
||||||
|
return "http://localhost:8080/ws";
|
||||||
|
} else {
|
||||||
|
return `${protocol}//${host}/ws`;
|
||||||
|
}
|
||||||
|
}
|
||||||
root.render(
|
root.render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
<StompSessionProvider url={wsUrl} connectHeaders={{}} logRawCommunication={true}
|
<StompSessionProvider url={wsUrl()} connectHeaders={{}} logRawCommunication={true}
|
||||||
debug={(str) => {
|
debug={(str) => {
|
||||||
if (str === "Opening Web Socket...") {
|
if (str === "Opening Web Socket...") {
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user