Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
export let scalingDevtoolsValTown2 = (req: Request) => {
const format = new URL(req.url).searchParams.get("format");
if (!format) {
return Response.json({
"message": "Please provide a 'format' parameter e.g. 'video'",
});
}
if (format === "video") {
return Response.redirect(
"https://youtu.be/tUXXANGzE1I?si=DNAWyBwACWEnc9Al",
);
}
else {
return Response.redirect(
"https://podcast.scalingdevtools.com/episodes/steve-krouse",
);
}
};
jack-scalingdevtoolsvaltown2.web.val.run
October 23, 2023