diff --git a/app/page.tsx b/app/page.tsx index 5705d4e..f12bdf8 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,113 +1,77 @@ -import Image from "next/image"; + + +// const lat: string = '55.645519'; +// const long: string = '12.549600'; + +// interface Forecast { +// [coord: string]: { +// [lon: string]: number; +// [lat: string]: number; +// }, +// [weather: string]: [ +// { +// [id: string]: number, +// [main: string]: string, +// [description: string]: string, +// [icon: string]: string; +// } +// ], +// [base: string]: string; +// [main: string]: { +// [temp: string]: number; +// [feels_like: string]: number; +// [temp_min: string]: number; +// [temp_max: string]: number; +// [pressure: string]: number; +// [humidity: string]: number; +// [sea_level: string]: number; +// [grnd_level: string]: number; +// }, +// [visibility: string]: number; +// [wind: string]: { +// [speed: string]: number; +// [deg: string]: number; +// [gust: string]: number; +// }, +// [rain: string]: { +// [onehour: string]: number +// }, +// [clouds: string]: { +// [all: string]: number +// }, +// [dt: string]: number, +// [sys: string]: { +// [type: string]: number, +// [id: string]: number, +// [country: string]: string, +// [sunrise: string]: number, +// [sunset: string]: number; +// }, +// [timezone: string]: number; +// [id: string]: number; +// [name: string]: string; +// [cod: string]: number; +// }; + + +interface LocationType { + latitude: number; + longtitude: number; +} + + +function async getForecast(location: LocationType) { + const {latitude, longtitude} = location; + const forecast = fetch(`https://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longtitude}&appid=${API_key}`) + return forecast +} export default function Home() { return ( -
-
-

- Get started by editing  - app/page.tsx -

-
- - By{" "} - Vercel Logo - -
-
+
+

The weather in Sluseholmen for the next 3 days

+ -
- Next.js Logo -
- -
- -

- Docs{" "} - - -> - -

-

- Find in-depth information about Next.js features and API. -

-
- - -

- Learn{" "} - - -> - -

-

- Learn about Next.js in an interactive course with quizzes! -

-
- - -

- Templates{" "} - - -> - -

-

- Explore starter templates for Next.js. -

-
- - -

- Deploy{" "} - - -> - -

-

- Instantly deploy your Next.js site to a shareable URL with Vercel. -

-
-
); } diff --git a/package.json b/package.json index 6f91584..8832025 100644 --- a/package.json +++ b/package.json @@ -9,18 +9,18 @@ "lint": "next lint" }, "dependencies": { + "next": "14.2.3", "react": "^18", - "react-dom": "^18", - "next": "14.2.3" + "react-dom": "^18" }, "devDependencies": { - "typescript": "^5", "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", + "eslint": "^8", + "eslint-config-next": "14.2.3", "postcss": "^8", "tailwindcss": "^3.4.1", - "eslint": "^8", - "eslint-config-next": "14.2.3" + "typescript": "^5" } }