import { gron } from "https://esm.town/v/u/gron";
export default async function untitled_roseClownfish(req: Request): Promise<Response> {
let url: URL;
try {
url = new URL(new URL(req.url).searchParams.get("url"));
}
catch {
return new Response(
"<html><body>Not a valid URL - " + new URL(req.url).search
+ "</body></html>",
{
headers: {
"Content-Type": "text/html",
},
},
);
}
return new Response(gron(await (await fetch(url)).json()));
}