I write a small weather details fetch web application from external API. you cna look see it on GitHub:
This is application using https://openweathermap.org/ API's to fetch the weather details with sending city name.
Weather app is created using Node.js, Express.js framework to create the API's. To fetch weather details we used https://openweathermap.org/api.
- Backend: Node.js, ExpressJs (Framework)
- API: https://openweathermap.org/api
Steps to Run
Clone the repository on your machine (Desktop/Laptop) using following command
git clone https://github.com/abhishekdhapare9392/weather-app-node-js.git
copy .env.expample file to .env and add
API_KEY value with your API key. To get API key visit Open Weather Map API link.
To hide the API Key and url of openweathermap. This is a best example of Opps concept, Abstraction.
To avoid to reveal the API key and resource of third party API in DevTools->Source.
Please visit the GitHub link and follow the document. After you completed the process you will be on browser. (Hopefully on Chrome). Open the Developer Tools->Source you can see the all files loading which required. Click on JS->script.js file and you can see code in side window. If you see carefully and read the code there is an API call without API key and resource link. Please go through it and let me know. I would like to discuss if any one have doubts or queries.