Sample implementation to demonstrate how to extend the default NestJS Configuartion Service to fetch configuration from Azure KeyVault.
This repository contains a sample implementation of ConfigService
in NestJS
extended using custom provider to fetch values from Azure KeyVault.
$ pnpm install
This application has a .env.example file. Please create a .env file and update the value as with the respective details. The below table describes the environment variables used in the application:
Environment Variable | Description |
---|---|
AZURE_KEYVAULT_URI |
Azure KeyVault URI |
The application can be run in two modes, development
and production
. The development
mode supports hot reloading which is beneficial during development. The production
mode is optimized for performance.
Execute the below command to run the application in development mode:
$ pnpm run start:dev
Execute the below command to run the application in production mode:
$ pnpm run start:prod
The application has tests configured using Jest
. The tests are located in the test
directory. The tests are also configured to generate coverage reports. The coverage reports are generated in the coverage
directory.
Execute the below command to run the unit tests:
$ pnpm run test
Execute the below command to run the tests and generate the coverage reports:
$ pnpm run test:cov
The application and all associated source code are distributed under the MIT License.
In case you find the project helpful, please consider supporting by ⭐ the project.
Contributions are welcome! Please feel free to submit a Pull Request in case you find any issues with the code.