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" } },
)
}