tmcw-fuchsiasnipe.web.val.run
1
2
3
4
5
6
7
8
9
export default async function(req: Request): Promise<Response> {
const response = await fetch("http://worldtimeapi.org/api/timezone/America/New_York")
const timeData = await response.json()
return new Response(
JSON.stringify({ datetime: timeData.datetime }),
{ headers: { "Content-Type": "application/json" } },
)
}
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
June 18, 2024