Skip to content
16 linesCodeBlameRaw

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

Catch up with main1// /api says what this deployment was given; everything else is the site.
2export default {
3 async fetch(request, env) {
4 const url = new URL(request.url);
5 if (url.pathname === "/api") {
6 return Response.json({
7 fromConfig: env.FROM_CONFIG ?? null,
8 greeting: env.GREETING ?? null,
9 apiUrl: env.API_URL ?? null,
10 // Only a prefix: enough to tell the test key from the live one.
11 stripeKey: env.STRIPE_KEY ? `${env.STRIPE_KEY.slice(0, 8)}…` : null,
12 });
13 }
14 return env.ASSETS.fetch(request);
15 },
16};

This file's history is long; its oldest lines are credited to the oldest commit read.