script pour setUp les adresses

demo_bourges
Thomas Chazot 1 year ago
parent d68b80d96d
commit f48168639a

@ -0,0 +1,15 @@
#!/bin/bash
# Vérifier si l'adresse IP est fournie en tant que paramètre
if [ -z "$1" ]; then
echo "Usage: $0 <adresse_ip>"
exit 1
fi
# Stocker l'adresse IP fournie en tant que variable
adresse_ip="$1"
# Utiliser l'adresse IP dans la commande find avec Perl
find . -type f -exec perl -pi -e 's|http://[0-9.]+:([0-9]+)|http://localhost:$1|g' {} +
find . -type f -exec perl -pi -e "s|http://localhost:([0-9]+)|http://$adresse_ip:\$1|g" {} +

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

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

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

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

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

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save