How’s The Weather?: My Journey Into Using APIs

how's the weather

My latest programming project is How’s The Weather: A website that allows users to input a city and state into a form to view the weather in that city. You can view it here and the code running the site here.

How’s The Weather?: The Reason Behind This Website

While I was taking my Web Development course on Udemy one of the sections was to learn how to use APIs. The API the instructor used was the OpenWeatherMap API because it was free to use and easy to implement. During that section we built a very simple website displaying the weather after the user entered their city and state.

However, the site was barebones and didn’t have much functionality. I decided to spruce it up a bit and actually display the results instead of sending it back to the user. (In the course we use res.send instead of res.render to display the local weather for ease of use.)

The Current How’s The Weather Deployment Has A Problem, However

There is a problem with my website: If the user misspells the city, or if the API cannot find the city, the program will crash.

This is a big issue and one I’m currently working on to fix. However, I haven’t found the solution yet. I do have an error page I want to redirect the user to but I can’t get the code to work properly. Really, I need to do more research on the Node.js https.get requests so I can code up a solution. Until then if the program crashes the user will have to reload the website.

Why Release This Then?

Why release this website if it has a major issue like that? To showcase the progress I made so far.


Thanks for reading this post and visiting Brittbot. Keep coming back to read my thoughts about WordPress, building your brand, website services, and programming topics.

0 0 votes
Article Rating
Share My Post!
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments