Question: For this assignment, You will create a NodeJS application which takes a city name as an input in its pug template. using openweathermap API, you

For this assignment, You will create a NodeJS application which takes a city name as an input in its pug template. using openweathermap API, you should get the weather of that particular city and displays that information to a new pug template. You should also store the results in a file in your directory. Following are the detailed requirements.

Your application should start with a pug template (similar to HTML page) which has a form with an input field and label to accept the city name and a button on clicking which we can send a GET request to the server.

Your server code (Back-end) should be able to take this city name, make an API call to the openweathermap API.

You should be able successfully to establish the API call and retrieve data from it.

You should also be able to display this data in a new pug template.

This same pug template will also have a form in which we should be able to enter the data you that we received from openweathermap.

On entering and submitting that data, You should be able to make a POST request to your back-end.

Your back-end code should write those values to a file in your local directory using async and fs.

Openweathermap API documentation: https://openweathermap.org/api

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!