fix: require VITE_CONVEX_URL env var for edge functions and clarify publishing workflow

- Add VITE_CONVEX_URL requirement to Netlify env vars for edge function runtime
- Improve error messages in edge functions when Convex URL is missing
- Add "How publishing works" explanation to README, setup guide, and docs
- Update deployment instructions across all documentation
This commit is contained in:
Wayne Sutton
2025-12-14 21:42:09 -08:00
parent 078fbe6698
commit c492b338b4
7 changed files with 31 additions and 17 deletions

View File

@@ -10,11 +10,11 @@ export default async function handler(
if (!convexUrl) {
return new Response(
JSON.stringify({ error: "Configuration error: Missing Convex URL" }),
{
status: 500,
headers: { "Content-Type": "application/json" },
},
JSON.stringify({
error:
"VITE_CONVEX_URL not set. Add it to Netlify environment variables.",
}),
{ status: 500, headers: { "Content-Type": "application/json" } },
);
}

View File

@@ -9,9 +9,10 @@ export default async function handler(
Deno.env.get("VITE_CONVEX_URL") || Deno.env.get("CONVEX_URL");
if (!convexUrl) {
return new Response("Configuration error: Missing Convex URL", {
status: 500,
});
return new Response(
"Configuration error: VITE_CONVEX_URL not set. Add it to Netlify environment variables.",
{ status: 500, headers: { "Content-Type": "text/plain" } },
);
}
// Construct the Convex site URL for the HTTP endpoint

View File

@@ -9,9 +9,10 @@ export default async function handler(
Deno.env.get("VITE_CONVEX_URL") || Deno.env.get("CONVEX_URL");
if (!convexUrl) {
return new Response("Configuration error: Missing Convex URL", {
status: 500,
});
return new Response(
"Configuration error: VITE_CONVEX_URL not set. Add it to Netlify environment variables.",
{ status: 500, headers: { "Content-Type": "text/plain" } },
);
}
// Construct the Convex site URL for the HTTP endpoint