Compare commits
No commits in common. "274c0b98e3d64741259db4b97a17fcdba600f58e" and "fb68e6d43a94b6b45cee7343790719f9d3dd88c4" have entirely different histories.
274c0b98e3
...
fb68e6d43a
4
.env
4
.env
@ -1,8 +1,8 @@
|
|||||||
# MongoDB connection for backend
|
# MongoDB connection for backend
|
||||||
CONNECTION_URI=mongodb://admin:adminpassword@192.168.0.197:27018/ludo?authSource=admin&replicaSet=rs0
|
CONNECTION_URI=mongodb://admin:adminpassword@192.168.0.197:27017/ludo?authSource=admin&replicaSet=rs0
|
||||||
|
|
||||||
# Backend port
|
# Backend port
|
||||||
PORT=3000
|
PORT=8080
|
||||||
|
|
||||||
# Environment
|
# Environment
|
||||||
NODE_ENV=development
|
NODE_ENV=development
|
||||||
@ -13,13 +13,7 @@ function App() {
|
|||||||
const [playerSocket, setPlayerSocket] = useState();
|
const [playerSocket, setPlayerSocket] = useState();
|
||||||
const [redirect, setRedirect] = useState();
|
const [redirect, setRedirect] = useState();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let socket;
|
const socket = io(`http://${window.location.hostname}:8080`, { withCredentials: true });
|
||||||
if(process.env.NODE_ENV !== 'production') {
|
|
||||||
socket = io(`http://${window.location.hostname}:8080`, { withCredentials: true });
|
|
||||||
} else {
|
|
||||||
socket = io(`${window.location.protocol}//${window.location.host}`, { withCredentials: true });
|
|
||||||
}
|
|
||||||
|
|
||||||
socket.on('player:data', data => {
|
socket.on('player:data', data => {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
setPlayerData(data);
|
setPlayerData(data);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user