Files
CloudFlare-ImgBed/functions/api/manage/check.js
MarSeventh 4e0c55d1f9 init
2024-07-19 23:26:06 +08:00

17 lines
702 B
JavaScript

export async function onRequest(context) {
// Contents of context object
const {
request, // same as existing Worker API
env, // same as existing Worker API
params, // if filename includes [id] or [[path]]
waitUntil, // same as ctx.waitUntil in existing Worker API
next, // used for middleware or to fetch assets
data, // arbitrary space for passing data between middlewares
} = context;
if(typeof context.env.BASIC_USER == "undefined" || context.env.BASIC_USER == null || context.env.BASIC_USER == ""){
return new Response('Not using basic auth.', { status: 200 });
}else{
return new Response('true', { status: 200 });
}
}