Follow these steps to set up and run the Weather App on your local machine:
-
Install Node.js and npm:
- Download and install Node.js from nodejs.org.
-
Create a New Project Directory:
mkdir weather-app cd weather-app
-
Initialize a Node.js Project:
npm init -y
-
Install Dependencies:
npm install express express-handlebars request
-
Create Project Files:
touch app.js weatherData.js public/index.html public/css/styles.css views/index.hbs
-
Set Up Directory Structure:
mkdir public views public/css
-
Add Project Code:
- Copy and paste the code for
app.js
,weatherData.js
,index.hbs
, andstyles.css
into their respective files.
- Copy and paste the code for
-
Replace API Key (if applicable):
- If your project uses APIs that require an API key, replace the placeholder API key in your code with your actual API key.
-
Start the Server:
node app.js
-
Access Your Application:
- Open your web browser and navigate to
http://localhost:3000
or the port specified in yourapp.js
file to access your weather application.
- Open your web browser and navigate to
These steps will guide you through the setup process for running the Weather App locally. Adjust any file paths or configurations based on your project's structure and requirements.