mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-05-12 11:39:56 +08:00
10 lines
343 B
JavaScript
10 lines
343 B
JavaScript
const API_PATHS = ["/api/", "/open_api/", "/user_api/", "/admin/"]
|
|
|
|
export async function onRequest(context) {
|
|
const reqPath = new URL(context.request.url).pathname;
|
|
if (API_PATHS.map(path => reqPath.startsWith(path)).some(Boolean)) {
|
|
return context.env.BACKEND.fetch(context.request);
|
|
}
|
|
return await context.next();
|
|
}
|