breakout into monorepo

This commit is contained in:
Dominic Ferrando
2026-03-02 13:39:47 -05:00
parent 6421f6527f
commit 45acec2cfd
90 changed files with 12179 additions and 2987 deletions
+29
View File
@@ -0,0 +1,29 @@
export default {
async fetch(request, env, ctx): Promise<Response> {
const url = new URL(request.url);
const prefix = url.pathname.slice(1);
switch (request.method) {
case 'GET':
const listResponse = await env.media.list({ prefix, limit: 1000 });
const keys = listResponse.objects.map(o => o.key);
const headers = new Headers();
headers.set('Content-Type', 'application/json');
return new Response(JSON.stringify(keys), {
headers,
status: 200,
});
default:
return new Response(`${request.method} is not allowed.`, {
status: 405,
headers: {
Allow: 'GET',
},
});
}
},
} satisfies ExportedHandler<Env>;