From 8a0e32ce382612f465e12ec5c848b7a7599ba981 Mon Sep 17 00:00:00 2001 From: Omar Najjar Date: Mon, 31 Mar 2025 18:09:41 +1100 Subject: [PATCH] x --- worker.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/worker.js b/worker.js index 8153c4b..cce334d 100644 --- a/worker.js +++ b/worker.js @@ -27,6 +27,12 @@ export default { return handleOptions(); } + // Check if this is an API request (starts with /api/) + if (!path.startsWith('/api/')) { + // For non-API routes, pass through to Cloudflare Pages + return fetch(request); + } + // For GET requests, try to serve from cache first if (request.method === "GET") { // Create a cache key from the request URL @@ -2311,6 +2317,4 @@ async function createOrGetUser(request, env) { details: logError(error, { action: 'user_outer' }) }, 500); } - - } \ No newline at end of file