Configuring the application for deployment
We now have an application that, when code is pushed to git
, starts the process of building an image and deploying it. Our application currently gets deployed but it's not actually working, and this is happening because it is lacking configuration.
The first thing you probably noticed is that our application is always loading the configuration file from development, config.dev.yml
, and it shouldn't.
When we first implemented this, we thought that different environments would have different configurations, and we were right. At the time, we didn't need to have configurations for more than one environment, and we used dev
as a default. Let's fix that.
Remember that when we created the function that loads the configuration, we explicitly used an argument for the environment? We didn't use it at the time, but we left a default value.
Look at the following code snippet from src/config/index.ts
:
export async...