web-sys: Weather report

View full source code or view the compiled example online

This example makes an HTTP request to OpenWeather API, parses response in JSON and render UI from that JSON. It also shows the usage of spawn_local function for handling asynchronous tasks.

Please add your api key in get_response() before running this application.

src/lib.rs

{{#include ../../../examples/weather_report/src/lib.rs}}