Skip to content

Add /qa-status Netlify function for Prerender 5xx cache-refresh testing - #2

Merged
belminpre merged 1 commit into
mainfrom
qa/qa-status-function
Jun 9, 2026
Merged

Add /qa-status Netlify function for Prerender 5xx cache-refresh testing#2
belminpre merged 1 commit into
mainfrom
qa/qa-status-function

Conversation

@belminpre

Copy link
Copy Markdown
Contributor

A QA-only endpoint that returns either 200 + minimal HTML or a real HTTP 500 + minimal HTML, controlled at request time by the Netlify env var QA_FORCE_500. Used to exercise Prerender's error -> recovery flow by toggling the var and redeploying across deploys.

  • netlify/functions/qa-status.ts: new function, both branches return Content-Type: text/html; charset=utf-8 so only the status code varies.
  • netlify.toml: declare [functions] directory explicitly and add a /qa-status -> /.netlify/functions/qa-status rewrite (status = 200, preserves upstream status). The rewrite is placed ABOVE the SPA catch-all so it isn't swallowed by /* -> /index.html.

No app routes, pages, or dependencies changed.

A QA-only endpoint that returns either 200 + minimal HTML or a real
HTTP 500 + minimal HTML, controlled at request time by the Netlify env
var QA_FORCE_500. Used to exercise Prerender's error -> recovery flow
by toggling the var and redeploying across deploys.

- netlify/functions/qa-status.ts: new function, both branches return
  Content-Type: text/html; charset=utf-8 so only the status code varies.
- netlify.toml: declare [functions] directory explicitly and add a
  /qa-status -> /.netlify/functions/qa-status rewrite (status = 200,
  preserves upstream status). The rewrite is placed ABOVE the SPA
  catch-all so it isn't swallowed by /* -> /index.html.

No app routes, pages, or dependencies changed.

Co-authored-by: Cursor <cursoragent@cursor.com>
@belminpre
belminpre merged commit 2f10dbe into main Jun 9, 2026
1 check passed
@netlify

netlify Bot commented Jun 9, 2026

Copy link
Copy Markdown

Deploy Preview for weirdanimals ready!

Name Link
🔨 Latest commit fc7a0e6
🔍 Latest deploy log https://app.netlify.com/projects/weirdanimals/deploys/6a27cf9b25f15e000899f042
😎 Deploy Preview https://deploy-preview-2--weirdanimals.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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