Weather Journal is the third project of Udacity Front End Web Developer nanodegree program. It requires to build a single-page JavaScript app which creates a weather record for user based on their input and data from OpenWeatherMap API.
The goal of the project is to practice with:
- setting up Node environment with Express and project dependencies
- setting up a server with
GET
andPOST
routes - using
fetch API
with OpenWeatherMap API credentials - accessing a
GET
route on the server side from a function called on the client side - promise chaining
- dynamically updating properties of HTML elements
-
Local server (server.js) is running on
port 3030
. -
Data is retrieved from external OpenWeatherMap API in
JSON
format.- API calls use
zip code
entered by the user. Search works only for US zips.
- API calls use
-
The following values are updated dynamically:
- date
- temperature
- user input
Cool tech stuff used in this project:
- Node.js
- Express framework
- Node.js packages:
- Download Node.js.
- Install the following packages using
npm
.
$ npm install express
$ npm install cors
$ npm install body-parser
To run Weather Journal locally:
- Clone this repository.
cd
into project directory.- Start the local server from command line.
$ node server.js
- Open
http://localhost:3030
in your browser.
To use your own OpenWeatherMap API key,
- Create an account on https://openweathermap.org/api.
- In app.js, save your key in
apiKey
constant.
Alexandra Baturina