Skip to content

Move env-file loading into a shared helper #255

Description

@kilodesodiq-arch

Problem Statement. Env-file resolution appears twice: main.ts and
app.module.ts. Slight drift is possible between them.

Technical Context. app/backend/src/main.ts,
app/backend/src/app.module.ts.

Expected Outcome. A loadEnv() helper exported by
src/common/utils/env-loader.ts is the only place env files are searched; main.ts and
app.module.ts both call it.

Acceptance Criteria.

  • A test asserts both call paths agree on the final env state for a fixture of
    candidate env files.
  • Honest precedence: dotenv always wins over the OS env (or the opposite, with a
    documented order).

Files or modules likely to be affected.
new src/common/utils/env-loader.ts,
main.ts, app.module.ts.

Difficulty. Easy
Estimated effort. XS



Backlog item #47 from `docs/maintainer-issue-backlog.md.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions