{ JSON.stringify(data) }+ diff --git a/src/routes/aaaa/+page.server.ts b/src/routes/temps/+page.server.ts similarity index 58% rename from src/routes/aaaa/+page.server.ts rename to src/routes/temps/+page.server.ts index b329c55..e86e6d7 100644 --- a/src/routes/aaaa/+page.server.ts +++ b/src/routes/temps/+page.server.ts @@ -1,15 +1,17 @@ const headers = { 'X-API-KEY': '1FvqqqUpoeNgNpxZQxJX6FBDLbwKscx5hgXhZxUb', 'Content-type': 'application/json' } +const geocodingApiBase: string = "https://geocoding-api.open-meteo.com/v1/search"; +const openMeteoApiBase: string = "https://api.open-meteo.com/v1/forecast"; let location: string = "L'Hospitalet de Llobregat"; let municipis = await fetch('https://api.meteo.cat/referencia/v1/municipis', { method: 'GET', headers: new Headers(headers), credentials: 'include' }).then( (data) => data.json() ); -export function load(): { location: string, weatherData: Promise
El temps a: {data.location}
- +{ JSON.stringify(data.weatherData) }
{ JSON.stringify(data.openMeteoData) }+
{ JSON.stringify(data.consums) ?? 'No consum available' }+