Custom app launcher, browser home page, and service monitor. cute.haus
homelab react typescript
0

Configure Feed

Select the types of activity you want to include in your feed.

get lat/lon for weather from cloudflare headers

Aly Raffauf (Apr 26, 2026, 12:02 PM EDT) 56e0386c fdf9020e

+3 -3
+1 -1
src/components/Weather.tsx
··· 46 46 47 47 useEffect(() => { 48 48 const fetchWeather = (lat: number, lon: number) => { 49 - fetch(`/api/weather?lat=${lat}&lon=${lon}`) 49 + fetch(`/api/weather`) 50 50 .then((response) => response.json()) 51 51 .then((data) => { 52 52 if (data.error) {
+2 -2
src/index.ts
··· 90 90 "/api/weather": { 91 91 async GET(req) { 92 92 const url = new URL(req.url); 93 - const lat = url.searchParams.get("lat"); 94 - const lon = url.searchParams.get("lon"); 93 + const lat = req.headers.get("cf-iplatitude") ?? "33.749"; 94 + const lon = req.headers.get("cf-iplongitude") ?? "-84.388"; 95 95 96 96 try { 97 97 const pointsResponse = await fetch(