Skip to content

Separate Dotenv Config from AppConfig build.#427

Open
joneubank wants to merge 2 commits intomainfrom
feat/env-config-on-startup
Open

Separate Dotenv Config from AppConfig build.#427
joneubank wants to merge 2 commits intomainfrom
feat/env-config-on-startup

Conversation

@joneubank
Copy link
Contributor

@joneubank joneubank commented Mar 5, 2026

Summary

This change makes the dotenv config run at the moment appConfig.ts is imported, instead of occurring as part of the getAppConfig call.

This will have very few changes to the application, but is relevant to our test setup. We are now able to set process.env values for test purposes before calling getAppConfig(). This allows us to overwrite local environment variables that are found when the test suite is run.

This has an immediate impact on the CORS_ALLOWED_ORIGINS tests which were being interfered with by local .env files.

Readiness Checklist

  • Self Review
    • I have performed a self review of code
    • I have run the application locally and manually tested the feature
    • I have checked all updates to correct typos and misspellings
  • Formatting
    • Code follows the project style guide
    • Autmated code formatters (ie. Prettier) have been run
  • Local Testing
    • Successfully built all packages locally
    • Successfully ran all test suites, all unit and integration tests pass
  • Updated Tests
    • Unit and integration tests have been added that describe the bug that was fixed or the features that were added
  • Documentation
    • All new environment variables added to .env.schema file and documented in the README
    • All changes to server HTTP endpoints have open-api documentation
    • All new functions exported from their module have TSDoc comment documentation

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants