We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eeb6c08 commit c97206fCopy full SHA for c97206f
functions/media/[[all]].js
@@ -0,0 +1,8 @@
1
+export async function onRequestGet(ctx) {
2
+ const path = new URL(ctx.request.url).pathname.replace("/media/", "");
3
+ const file = await ctx.env.MEDIA.get(path);
4
+ if (!file) return new Response(null, { status: 404 });
5
+ return new Response(file.body, {
6
+ headers: { "Content-Type": file.httpMetadata.contentType },
7
+ });
8
+}
src/app/contents.json
@@ -161,7 +161,7 @@
161
"deathdate": "",
162
"images": [
163
"https://i.imgur.com/7Z5UHr3.jpg",
164
- "https://pub-de0e381b0f7043a297494a2012c5777f.r2.dev/PixieHappyCountertop.mp4"
+ "/media/PixieHappyCountertop.mp4"
165
],
166
"imageAlt": "Images of Pixie the cat",
167
"sounds": [
0 commit comments