Reputation: 9232
I am new to RN and trying to figure out how I can utilize environment specific configuration.
For example, the code I have hitting my Server API needs to change based on the environment
const endpoint = "http://localhost:8282/api/v1/auth/"
//staging endpoint "http://staging:8282/api/v1/auth"
//production endpoint "http://production:8282/api/v1/auth"
export default {
login(fbId,fbAccessToken,expiresIn){
return fetch(endpoint + 'login', {
method: 'post',
body: JSON.stringify({
fb_id: fbId.toString(),
access_token:fbAccessToken,
expires:expiresIn.toString()
})
})
}
}
Upvotes: 0
Views: 130