mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-05-11 18:10:01 +08:00
16 lines
380 B
JavaScript
16 lines
380 B
JavaScript
const API_PATHS = [
|
|
"/api/",
|
|
"/open_api/",
|
|
"/user_api/",
|
|
"/admin/",
|
|
"/telegram/"
|
|
];
|
|
|
|
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();
|
|
}
|