Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript

nishantr
nishantr
6,326 Points

building an API with express node.js

I have to build an API for weather application using express node.js. since I am not saving any data, I am not using the database. my application allows the user to enter a city name, and the weather information will retrieve directly from the openweathermap.org

the question is, I have a working javascript application, but how to GET the weather data from openweathermap.org in the API route city/:cityName

1 Answer

rydavim
rydavim
18,780 Points

It's difficult to answer your question with specifics without seeing where you're at in your code. The documentation of the API section you're looking for is probably on this page. Note that you'll need an API key to use their API.

If that doesn't get you on the right track, please post your code here as a workspace snapshot. You could also use a similar service such as codepen if you're more comfortable with that.