Skip to content

hannahw1ll1ams/trackeroo-client

Repository files navigation

trackeroo-client

Setting up Environment Variables

In the root of the project, create an environment.js file and add the following:

import Constants from "expo-constants";

const apiUrl = "your-api-url";
const webSocketUrl =
  "your-websocket-url";

const ENV = {
  dev: {
    apiUrl,
    webSocketUrl
  },
  prod: {
    apiUrl,
    webSocketUrl
  }
};

const getEnvVars = (env = Constants.manifest.releaseChannel) => {
  if (__DEV__) {
    return ENV.dev;
  } else if (env === "staging") {
    return ENV.staging;
  } else if (env === "prod") {
    return ENV.prod;
  }
};

export default getEnvVars;


About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •