mirror of
https://github.com/MarSeventh/CloudFlare-ImgBed.git
synced 2026-05-01 01:16:31 +00:00
init
This commit is contained in:
17
functions/api/manage/delete/[id].js
Normal file
17
functions/api/manage/delete/[id].js
Normal file
@@ -0,0 +1,17 @@
|
||||
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;
|
||||
console.log(env)
|
||||
console.log(params.id)
|
||||
await env.img_url.delete(params.id);
|
||||
const info = JSON.stringify(params.id);
|
||||
return new Response(info);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user