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.

query city/state from nws api

Aly Raffauf (Jan 30, 2026, 12:07 PM EST) f643c3e9 c1e0d736

+18 -1
+5
src/components/Weather.tsx
··· 38 38 temperature: number; 39 39 temperatureUnit: string; 40 40 shortForecast: string; 41 + city: string; 42 + state: string; 41 43 } | null>(null); 42 44 43 45 const [error, setError] = useState<string | null>(null); ··· 74 76 <span className="text-zinc-500">{weather.temperatureUnit}</span> 75 77 </div> 76 78 <div className="text-zinc-400">{weather.shortForecast}</div> 79 + <div className="text-zinc-400"> 80 + {weather.city}, {weather.state} 81 + </div> 77 82 </div> 78 83 </div> 79 84 </div>
+13 -1
src/index.ts
··· 95 95 96 96 const pointsResponse = await fetch( 97 97 `https://api.weather.gov/points/${lat},${lon}`, 98 + { 99 + headers: { 100 + "User-Agent": "(watsup, aly@aly.codes)", 101 + }, 102 + }, 98 103 ); 99 104 100 105 const pointsData = await pointsResponse.json(); 101 106 const forecastUrl = pointsData.properties.forecast; 102 107 const forecastResponse = await fetch(forecastUrl); 103 108 const forecastData = await forecastResponse.json(); 104 - return Response.json(forecastData.properties.periods[0]); 109 + 110 + const location = pointsData.properties.relativeLocation.properties; 111 + 112 + return Response.json({ 113 + ...forecastData.properties.periods[0], 114 + city: location.city, 115 + state: location.state, 116 + }); 105 117 }, 106 118 }, 107 119