DEV Community

Discussion on: Fetch API in node.js with weather API

Collapse
 
miguelznunez profile image
Miguel Z. Nunez

What if you search for the weather by user input? How would we set this up ?

Collapse
 
pratham82 profile image
Prathamesh Mali • Edited

If you're using react and express the you can set up simple form in react to take the input and the form's action will be post which will hit an endpoint in express. The express endpoint will call the weather API and send the response back to frontend.
If you want a solution in vanilla js then this is one example github.com/Pratham82/Weather-JS.