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
import main from "https://esm.town/v/parthstown/prettyBrownBuzzard";
console.log("potato", main);
export default async function printWeather(req: Request) {
if (typeof main === "function") {
const newWeather = await main(req);
const data = await newWeather.json();
console.log(newWeather);
return new Response(JSON.stringify(data));
} else {
console.error("main is not a function");
return new Response("Error: main is not a function", { status: 500 });
}
}
parthstown-aloneaquagopher.web.val.run
August 20, 2024