Skip to content

Commit

Permalink
Add config variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
desyco committed Aug 28, 2024
1 parent 13c9c80 commit 601ff9c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/config/appConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ class Configuration {
logPretty(){
return process.env.LOG_PRETTY === "true";
}
exampleConfig(){
return process.env.EXAMPLE_CONFIG;
}
}

export default new Configuration()
Expand Down
4 changes: 4 additions & 0 deletions src/services/exampleService.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import exampleRepo from "../repos/exampleRepo.js"
import config from "../config/appConfig.js"
import logger from "../utils/logger.js";

export class ExampleService {

async getById(id) {
const example = config.exampleConfig()
logger.info("config", example)
return await exampleRepo.getById(id)
}

Expand Down

0 comments on commit 601ff9c

Please sign in to comment.