Skip to main content
In a production app you need to have different config versions for local development, staging and production. Here’s how to do it with Typeconf.

Creating a config

Let’s create a schema for our config:
Now let’s create a default config under configs/agent.config.ts:

Environment based configs

Using this config we can create a separate config for each environment: Dev:
Staging:
You should end up with this directory structure:

Reading in your project

In you code you can just parametrize path depending on environment: