Variable d'environnement pour l'URL du serveur API
This commit is contained in:
parent
4da75e310e
commit
72862da3a6
@ -1 +1,5 @@
|
|||||||
|
# Public variables
|
||||||
|
EXPO_PUBLIC_TRAINTRAPE_MOI_SERVER=https://traintrapemoi.luemy.eu/api
|
||||||
|
|
||||||
|
# Build variables
|
||||||
ANDROID_HOME=/opt/android-sdk
|
ANDROID_HOME=/opt/android-sdk
|
1
client/.env.development
Normal file
1
client/.env.development
Normal file
@ -0,0 +1 @@
|
|||||||
|
EXPO_PUBLIC_TRAINTRAPE_MOI_SERVER=http://localhost:3000/
|
@ -23,7 +23,7 @@ export default function Login() {
|
|||||||
if (loggingIn)
|
if (loggingIn)
|
||||||
return
|
return
|
||||||
setLoggingIn(true)
|
setLoggingIn(true)
|
||||||
const resp = await fetch("http://192.168.1.198:3000/auth/login/", {
|
const resp = await fetch(`${process.env.EXPO_PUBLIC_TRAINTRAPE_MOI_SERVER}/auth/login/`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
body: JSON.stringify({ name: name, password: password })
|
body: JSON.stringify({ name: name, password: password })
|
||||||
|
Loading…
Reference in New Issue
Block a user