Project created by Steven Jack Chung
Project created using OpenWeatherMap API and Unsplash API
Weather App is a dynamic app that shows the current weather of different countries. Used JavaScript with DOM API to render and manipulate HTML. Implemented asynchrous functions and promises to access public APIs; OpenWeatherMap API to render the weather information and Unsplash API to render the background depending on the current weather.
- HTML
- CSS
- Bootstrap
- JavaScript
- OpenWeatherMap API
- Unsplash API
This project was created to understand more about how api worked and how to access it in JavaScript.
To get a local copy up and running follow these simple example steps.
Computer running Mac OS, Windows, or Linux Ubuntu. Internet browser: Firefox, Google Chrome, Opera...
Install NodeJs
Download the code or copy the git repository to your computer.
To install dependencies you need to run the following command in your terminal.
npm install
Run live server extension in VSCode or run the index.html file in dist folder from the cloned repository.
To create your own environmental variable for your API Key create a .env
file in your root folder. Add .env
to your gitignore as well if not added.
In your .env
file create a variable and assign your key to it.
// .env file
API_KEY=123Abc456DefG...
API_KEY2=123Abc456DefG...
To use your API key use process.env
and attach your API variable.
weatherKey = process.env.API_KEY;
After changing the code you will need to compile your work to be able to run.
Use these scripts to compile your work.
Build to compile once your code.
npm run build
Watch script to compile everytime you make a change, great combination with live server extension.
npm run watch
👤 Steven Jack Chung
- GitHub: @jcy2704
- Twitter: @yiak_
- LinkedIn: Steven Jack Chung
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
Give a ⭐️ if you like this project!