Initialize Express/React scaffolding#2
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| import scansRouter from './src/routes/scans.js'; | ||
| import { loadConfig } from './src/utils/config.js'; | ||
|
|
||
| dotenv.config(); |
There was a problem hiding this comment.
Load .env before importing routes
In backend/index.js the route modules are imported (lines 6–10) before dotenv.config() runs on line 13, but each route module calls loadConfig() at module scope. Because ES module imports execute before the body of this file, those loadConfig() calls see only the bare process environment, so .env values for admin credentials, payment mock mode, and trip timing are silently ignored and defaults are used. Running the API with a .env file will therefore authenticate against admin@example.com/changeme and always enable mock payments regardless of the intended configuration.
Useful? React with 👍 / 👎.
Summary
Testing
Codex Task