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.

What's the right way to holding configuration for multi-env?

See original GitHub issue

hold env config like: ip, port, db, …

config/
dev.ts
prod.ts
test.ts

I have multi modules in project, should I create a shared module to hold env config?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
trainerbillcommented, Mar 17, 2018

Are there plans to build @kamilmysliwiec recommendation into the framework?

4reactions
kamilmysliwieccommented, Mar 9, 2018

Additionally, you can do it in more nest-way, using custom providers. Example:

provide: ConfigService,
useClass: process.env.NODE_ENV === 'development' 
     ? DevelopmentConfigService 
     : ProductionConfigService

where ConfigService is an abstract class and both DevelopmentConfigService and ProductionConfigService extends ConfigService.

Read more comments on GitHub >

github_iconTop Results From Across the Web

A common way of managing configurations for multiple ...
This approach allows us to make changes to config data in one of the branches and the changes get propagated right away to...
Read more >
4 Methods to configure multiple environments in the AWS CDK
The main idea behind it is to have the configuration values that determine what resources are being built, committed alongside your CDK code....
Read more >
How to Model Your Gitops Environments - Codefresh
If you want to do changes to multiple environments at the same time, it is best to use the “variants” folder. The variants...
Read more >
Multi-env AWS with Terraform and Terragrunt in one hour
tl;dr This guide is for people who want to get started with AWS and Terraform, who want to do it properly, securely and...
Read more >
How to organize terraform modules for multiple environments?
But I will show you how I use terraform in my productions in different companies. ... It's easy to tell what module need...
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