Update MongoDB connection settings and enhance debugging capabilities
This commit is contained in:
+3
-1
@@ -13,7 +13,7 @@ function App() {
|
||||
const [playerSocket, setPlayerSocket] = useState();
|
||||
const [redirect, setRedirect] = useState();
|
||||
useEffect(() => {
|
||||
const socket = io(`${window.location.protocol}//${window.location.host}`, { withCredentials: true });
|
||||
const socket = io(`http://${window.location.hostname}:8080`, { withCredentials: true });
|
||||
socket.on('player:data', data => {
|
||||
data = JSON.parse(data);
|
||||
setPlayerData(data);
|
||||
@@ -72,3 +72,5 @@ function App() {
|
||||
</SocketContext.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import './index.css';
|
||||
import App from './App';
|
||||
import App from './App.js';
|
||||
|
||||
const container = document.getElementById('root');
|
||||
const root = ReactDOM.createRoot(container);
|
||||
|
||||
Reference in New Issue
Block a user