AS a developer, I want the configuration to use a JSON object rather than .env #130

Closed
opened 2023-12-29 18:52:06 +00:00 by Vylpes · 1 comment
Owner

Epic:
Story Points: 8


AS a developer, I want the configuration to use a JSON object rather than .env
SO THAT the config is cleaner

Acceptance Criteria

AS a developer
GIVEN I want to configure the bot using config.json
WHEN the bot starts
THEN the bot will load the config out of this file instead

AS a developer
GIVEN I want to configure the bot with environment variables
WHEN I set an environment variable starting with BOT_
THEN the bot will map these to the config json as well

Subtasks

  • Load the config into the bot on start
  • Map environment variables to config json

Notes

  • The mapped environment variables will be prefixed with BOT_ and separated by underscores
    • Example: BOT_DISCORD_TOKEN=test will be mapped to JSON as { discord: { token: "test" } }
Epic: \ Story Points: 8 --- AS a developer, I want the configuration to use a JSON object rather than .env SO THAT the config is cleaner ## Acceptance Criteria AS a developer GIVEN I want to configure the bot using `config.json` WHEN the bot starts THEN the bot will load the config out of this file instead AS a developer GIVEN I want to configure the bot with environment variables WHEN I set an environment variable starting with `BOT_` THEN the bot will map these to the config json as well ## Subtasks - [ ] Load the config into the bot on start - [ ] Map environment variables to config json ## Notes - The mapped environment variables will be prefixed with `BOT_` and separated by underscores - Example: `BOT_DISCORD_TOKEN=test` will be mapped to JSON as `{ discord: { token: "test" } }`
Author
Owner

Should also maybe have a function to still use .env to translate to a JSON config, so we can configure in CI.

Such as: express:token=test would go to in the json as express: { token: "test" }

Should also maybe have a function to still use .env to translate to a JSON config, so we can configure in CI. Such as: `express:token=test` would go to in the json as `express: { token: "test" }`
Vylpes added the
type
story
label 2023-12-29 18:52:14 +00:00
Vylpes changed title from Move to JSON config over .env for projects to AS a developer, I want the configuration to use a JSON object rather than .env 2024-01-21 15:17:57 +00:00
Vylpes added the
won't fix
label 2024-05-12 15:16:04 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: External/card-drop#130
No description provided.