Behind edge ✓host verge.run.placeproto httpscdn-loop vergcloud-staging; count=1
← Feature map

Edge Functions smoke

Origin serves a fallback fingerprint. Attach an edge function route in the panel; when it matches, the function body should replace the origin JSON.

Quick setup — Edge Functions smoke

Applies Verge config for this lab (edge-functions). Preflight (active domain + reachable CDN) runs first and must pass. Key stays in memory and is proxied server-side.

Example config

  • Create a function that returns fingerprint EDGE-FN-HANDLED
  • Attach route to /api/origin/edge-fn/fallback* (or rewrite via page-rule)
  • Publish/activate the function, then probe from this lab

Setup guide

CDN → Edge Functions → routes / page-rule attachment

Suggested config

  • Create a function that returns fingerprint EDGE-FN-HANDLED
  • Attach route to /api/origin/edge-fn/fallback* (or rewrite via page-rule)
  • Publish/activate the function, then probe from this lab

Verify

  1. Without attachment → ORIGIN-EDGE-FN-FALLBACK
  2. With attachment → EDGE-FN-HANDLED (or your function body), not origin-reached

Origin routes

All probes are same-origin through the CDN hostname. Open routes in a new tab to compare edge vs origin headers.

Sample function snippet
// Attach this (or equivalent) to path /api/origin/edge-fn/fallback*
// Return a distinct body so the lab can detect the function.
export default async function handler(request) {
  return new Response(
    JSON.stringify({
      fixture: "edge-fn-handled",
      "edge-function": true,
      fingerprint: "EDGE-FN-HANDLED",
    }),
    { headers: { "content-type": "application/json" } },
  );
}
No request yet — hit a button above to run a probe.