This commit is contained in:
2023-07-22 19:37:46 +01:00
parent 74a3cd7754
commit b1f93c9fd8
65 changed files with 1115 additions and 1029 deletions

View File

@ -1,7 +1,6 @@
interface Env {
}
interface Env {}
export const onRequest: PagesFunction<Env> = async (context) => {
export const onRequest: PagesFunction<Env> = async context => {
const id = context.params.id as string;
const next = await context.next();
@ -11,16 +10,16 @@ export const onRequest: PagesFunction<Env> = async (context) => {
body: await next.arrayBuffer(),
headers: {
"user-agent": "Snort-Functions/1.0 (https://snort.social)",
"content-type": "text/plain"
}
"content-type": "text/plain",
},
});
if (rsp.ok) {
const body = await rsp.text();
if (body.length > 0) {
return new Response(body, {
headers: {
"content-type": "text/html"
}
"content-type": "text/html",
},
});
}
}
@ -28,4 +27,4 @@ export const onRequest: PagesFunction<Env> = async (context) => {
// ignore
}
return next;
}
};

View File

@ -1,7 +1,6 @@
interface Env {
}
interface Env {}
export const onRequest: PagesFunction<Env> = async (context) => {
export const onRequest: PagesFunction<Env> = async context => {
const id = context.params.id as string;
const next = await context.next();
@ -11,16 +10,16 @@ export const onRequest: PagesFunction<Env> = async (context) => {
body: await next.arrayBuffer(),
headers: {
"user-agent": "Snort-Functions/1.0 (https://snort.social)",
"content-type": "text/plain"
}
"content-type": "text/plain",
},
});
if (rsp.ok) {
const body = await rsp.text();
if (body.length > 0) {
return new Response(body, {
headers: {
"content-type": "text/html"
}
"content-type": "text/html",
},
});
}
}
@ -28,4 +27,4 @@ export const onRequest: PagesFunction<Env> = async (context) => {
// ignore
}
return next;
}
};

View File

@ -1,8 +1,8 @@
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"lib": ["esnext"],
"types": ["@cloudflare/workers-types"]
}
}
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"lib": ["esnext"],
"types": ["@cloudflare/workers-types"]
}
}