Skip to content

Is there a way to check the current project in a custom app? #3115

Closed Answered by Rhotimee
XohanOtero asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @XohanOtero, there are a couple of strategies to allow your application to determine the correct environment (production or development) and hence call the correct API.
The most common method is to use Environment Variables.
You can set an environment variable that your app can access and check. In a Node.js app, you could do something like:

if (process.env.NODE_ENV === 'production') {
    // use production API
} else {
    // use staging/development API
}

Let me know if this was helpful.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by XohanOtero
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants