Skip to content

fix(env): require FCC_API_URL in production - #684

Open
NewtonLC wants to merge 1 commit into
freeCodeCamp:mainfrom
NewtonLC:fix/require-fcc-api-url-in-production
Open

NewtonLC wants to merge 1 commit into
freeCodeCamp:mainfrom
NewtonLC:fix/require-fcc-api-url-in-production

Conversation

@NewtonLC

Copy link
Copy Markdown
Contributor

Without FCC_API_URL, the dashboard pages fall back to the mock student data. In production, the app started without it and showed the mock data instead of failing. Now the app does not start in production unless FCC_API_URL is set.

Changes Made:

  • util/env.ts: adds FCC_API_URL to the values production requires.
  • __tests__/utils/env.test.ts: a production env without FCC_API_URL reports "FCC_API_URL is not set". The test env uses a placeholder URL until the real API URL is confirmed.
  • .env.sample: notes that production requires FCC_API_URL.

Development does not change. With FCC_API_URL empty, the app still uses the mock data server.

On Node 26, pnpm test (325 tests) passes.

@NewtonLC
NewtonLC requested a review from a team as a code owner October 27, 2026 02:04
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.

1 participant