script pour setUp + fix pour localhost

demo_bourges
Thomas Chazot 7 months ago
parent f48168639a
commit 19957da05c

@ -7,7 +7,7 @@ const app = express();
const server = http.createServer(app);
const io = socketIO(server, {
cors: {
origin: ["http://172.20.10.4:3000", "http://172.20.10.4:3000"], // Remplacez par l'URL de votre application React
origin: ["http://localhost:3000", "http://localhost:3000"], // Remplacez par l'URL de votre application React
methods: ["GET", "POST"],
credentials: true
}

@ -1,6 +1,10 @@
const ADRESSE_WEBSERVER = "http://172.20.10.4:3002"
const ADRESSE_WEBSERVER = "http://localhost:3002"
const ADRESSE_DBSERVER = "http://localhost:3003"
const tmp = ADRESSE_DBSERVER
const mp2 = ADRESSE_WEBSERVER
const ADRESSE_DBSERVER = "http://172.20.10.4:3003"
const ADRESSE_WEBSITE = ""

@ -9,6 +9,8 @@ import { FormattedMessage } from 'react-intl';
import ButtonImgNav from '../Components/ButtonImgNav';
import defaultImg from "../res/img/Person.png"
import {loadImageAsync} from "../ImageHelper"
import { socket } from '../SocketConfig';
import JSONParser from '../JSONParser';
// @ts-ignore

@ -351,7 +351,7 @@ const InGame = ({locale, changeLocale}) => {
<img src={Info} alt="info" height="40"/>
</button>
</Link>
{/* <button className='button' onClick={() => openInNewTab('http://172.20.10.4:3000/play')}> //! avec url =={'>'} dangereux
{/* <button className='button' onClick={() => openInNewTab('http://localhost:3000/play')}> //! avec url =={'>'} dangereux
<img src={Check} alt="check" height="40"/>
</button> */}

@ -169,7 +169,7 @@ function Lobby() {
const copyGameLink = () => {
setShow(!show)
const gameLink = "http://172.20.10.4:3000/lobby?room="+ room;
const gameLink = "http://localhost:3000/lobby?room="+ room;
navigator.clipboard.writeText(gameLink)
.then(() => {
console.log('Lien copié avec succès !');
@ -180,7 +180,7 @@ function Lobby() {
};
const textAreaRef = useRef<HTMLTextAreaElement>(null);
const linkToCopy = "http://172.20.10.4:3000/lobby?room="+ room
const linkToCopy = "http://localhost:3000/lobby?room="+ room
const handleCopyClick = () => {
setShow(!show)
if(textAreaRef.current != null){

@ -140,7 +140,7 @@ const SoloGame = ({locale, changeLocale}) => {
<img src={Info} alt="info" height="40"/>
</button>
</Link>
{/* <button className='button' onClick={() => openInNewTab('http://172.20.10.4:3000/play')}> //! avec url =={'>'} dangereux
{/* <button className='button' onClick={() => openInNewTab('http://localhost:3000/play')}> //! avec url =={'>'} dangereux
<img src={Check} alt="check" height="40"/>
</button> */}

@ -13,7 +13,7 @@ const port = 3003;
// Middleware
app.use(cors(
{
origin: ["http://172.20.10.4:3000", "http://172.20.10.4:3000"],
origin: ["http://localhost:3000", "http://localhost:3000"],
credentials: true
}
)); // Autoriser les requêtes cross-origin

Loading…
Cancel
Save