News for hackers. Stuff that matters.
Re:Show HN: The current sky at your approximate location, as... by dlazaro on Saturday August 09, 2025 @04:03PM (#44849645)
There is no visible plumbing because it kinda is magic! Astro provides adapters for different server runtimes (e.g., Vercel, Cloudflare, Netlify), and it's basically just plug and play. The Cloudflare adapter exposes a bunch of bindings [1] through `Astro.locals.runtime`, which can be accessed during each request. The `cf` binding contains incoming request properties [2], including latitude and longitude.

These bindings (or at least some of them) are also mocked when developing locally, in a non-Cloudflare-Workers environment.

[1] https://developers.cloudflare.com/workers/wrangler/api/#supp...

[2] https://developers.cloudflare.com/workers/runtime-apis/reque...

Re:Show HN: The current sky at your approximate location, as... by cloudfudge on Saturday August 09, 2025 @04:13PM (#44849739)
Great explanation; thanks.
Re:Show HN: The current sky at your approximate location, as... by Theodores on Sunday August 10, 2025 @12:35PM (#44856320)
Any ideas on how to do this without the Cloud flare magic, so entirely in the client? Just based on time will suffice, with latitude approximated to somewhere such as London?