diff --git a/config/config-keys.config.ts b/config/config-keys.config.ts new file mode 100644 index 0000000..8a0deab --- /dev/null +++ b/config/config-keys.config.ts @@ -0,0 +1,20 @@ +/** + * Enum containing keys for configuration values related to paths. + */ +export const enum ConfigKeys { + /** + * Key for the logs path configuration. + */ + LOGS_PATH = 'default.paths.logsPath', + } + + /** + * Enum containing keys for configuration values related to messages. + */ + export const enum MessageKeys { + /** + * Key for the welcome message configuration. + */ + INDEX_WELCOME = 'default.messages.indexWelcome', + } + \ No newline at end of file diff --git a/src/modules/index/index.service.ts b/src/modules/index/index.service.ts index 1580cfd..4b006a5 100644 --- a/src/modules/index/index.service.ts +++ b/src/modules/index/index.service.ts @@ -1,3 +1,4 @@ +import { MessageKeys } from '@config/config-keys.config'; import { ConfigService } from '@nestjs/config'; import { Injectable } from '@nestjs/common'; @@ -8,7 +9,7 @@ export class IndexService { getIndex() { return { success: true, - message: this.configService.get('default.messages.indexWelcome'), + message: this.configService.get(MessageKeys.INDEX_WELCOME), }; } }