This is a Node.js Express application that provides weather forecasts for a given location using the OpenWeatherMap API and OpenStreetMap geocoding.
index.js(main server file, inMyProj/weather_forecast/)public/(static assets, if any)views/index.ejs(main EJS template)package.json(dependencies)
- Node.js and npm installed
- Internet connection (for API requests)
-
Clone the repository:
git clone <your-repo-url> cd MyProj/weather_forecast
-
Install dependencies:
npm install
-
Run the server:
node index.js
or (if using nodemon):
npx nodemon index.js
-
Open in browser: Go to http://localhost:3000
- Main server:
MyProj/weather_forecast/index.js - Views:
MyProj/weather_forecast/views/ - Static files:
MyProj/weather_forecast/public/
git clone <your-repo-url>
cd MyProj/weather_forecast
npm install
node index.js- Make sure to replace
<your-repo-url>with your actual GitHub repository URL. - The OpenWeatherMap API key is hardcoded in
index.js. For production, use environment variables.
Feel free to open issues or contribute!