question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I may be wrong but it seems react-slingshot doesn’t have any sort of app config setup.

I think it’ll be nice to have something like config/environment.js where config variables for the app can be set. This way, I can easily specify different configs for multiple environments, e.g API keys, baseUrls, app feature flags, e.t.c

Thoughts?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:36 (31 by maintainers)

github_iconTop GitHub Comments

1reaction
mikedevitacommented, Feb 9, 2017

@nickytonline https://github.com/mikedevita/gasloggr-frontend has it, build is a bit old but its essentially the same configs.

1reaction
fayimoracommented, Jan 10, 2017

@mikedevita btw did you get those eslint errors too?

Config currently looks like this:

const setupConfig = (environment) => {
  const ENV = {
    API_URL: 'http://localhost:8090'
  };

  if(environment==='development'){
    ENV.API_URL = 'http://localhost:8090';
  }

  if(environment==='production'){
    // FIXME: Need to load this from the environment. process.env seems useless.. or not?
    ENV.API_URL = 'https://api.prod-url-from-env.com';
  }

  return ENV;
};

// export the resulting config
export default setupConfig(process.env.NODE_ENV);

Only thing missing is the ability to read actual environment variables in that config

Read more comments on GitHub >

github_iconTop Results From Across the Web

What Is AWS AppConfig? - AWS AppConfig
AWS AppConfig, a capability of AWS Systems Manager, helps you manage, store, and safely deploy application configurations to your hosts at runtime.
Read more >
What is App.config in C#.NET? How to use it? - Stack Overflow
At its simplest, the app.config is an XML file with many predefined configuration sections available and support for custom configuration sections.
Read more >
How to add an app.config file to a project - Microsoft Learn
To add an application configuration file to a C# project ... In Solution Explorer, right-click the project node, and then select Add >...
Read more >
App Config
App Config is a configuration loader with schema validation. ... Export environment variables for usage in any application.
Read more >
AppConfig Community
Introducing The AppConfig Community ... A community focused on providing tools and best practices around native capabilities in mobile operating systems to enable ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found