These are the local files I created while following the Web Dev Simplified tutorial How To Build A Weather App In JavaScript Without Needing A Server.
I didn't clone or fork the project repo because I wanted to create everything from scratch. This was a good experience and I learned how to create a non-trivial JavaScript app without a framework.
- HTML/CSS/JavaScript
- Vite
- Axios
- Open Meteo's Free Weather API
npm install
npm run devInstall create-vite, run initializer, and create package.json: npm create vite@latest
- Project name: . (current directory)
- Framework: Vanilla
- Variant: JavaScript
Add axios to project: npm install axios
API URL with selected parameters: api.open-meteo.com
Remove the latitude, longitude, and timeZone parameters before passing that URL to axios.get() in ./src/weather.js
Some of Open Meteo's API parameters have changed since Kyle created the project. His code still works as-is so it must still support the older parameters.
current_weatheris nowcurrenttemperatureis nowtemperature_2mwindspeedis nowwind_speed_10m
weathercodeis now an array indailycalledweather_codeapparent_temperature_2m_maxis nowapparent_temperature_maxapparent_temperature_2m_minis nowapparent_temperature_min
I made some minor changes to use CSS variables for the colors.
