Skip to content

Commit 979f0d2

Browse files
ayushmishra2005Ayush Kumar Mishra
and
Ayush Kumar Mishra
authored
Added example for weather report using rust and webassembly (#2216)
Minor refactoring Updated readme file Updated readme file fixed build error Fixed build error Co-authored-by: Ayush Kumar Mishra <[email protected]>
1 parent 1a7d6de commit 979f0d2

File tree

12 files changed

+6321
-0
lines changed

12 files changed

+6321
-0
lines changed

examples/weather_report/Cargo.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[package]
2+
name = "rust-webassembly-weather-reports"
3+
description = "Weather Information System- Get the mood of your city on one click using Rust and Webassembly"
4+
version = "0.1.1"
5+
authors = ["Ayush <[email protected]>"]
6+
categories = ["wasm"]
7+
readme = "README.md"
8+
edition = "2018"
9+
10+
[lib]
11+
crate-type = ["cdylib"]
12+
13+
[dependencies]
14+
chrono = "0.4.11"
15+
reqwest = "0.10.6"
16+
wasm-bindgen-futures = "0.4.1"
17+
json= "*"
18+
wasm-bindgen = "0.2.63"
19+
gloo = "0.2.1"
20+
21+
[dependencies.web-sys]
22+
version = "0.3.40"
23+
features = ["Document", "Element", "HtmlElement", "Window"]

examples/weather_report/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# web-sys: Weather report
2+
3+
[View documentation for this example online][dox] or [View compiled example
4+
online][compiled]
5+
6+
[compiled]: https://rustwasm.github.io/wasm-bindgen/exbuild/weather_report/
7+
[dox]: https://rustwasm.github.io/docs/wasm-bindgen/examples/weather_report.html
8+
9+
You can build the example locally with:
10+
11+
```
12+
$ npm install
13+
$ npm run build
14+
$ npm start
15+
```
16+
17+
and then visiting http://localhost:8080 in a browser should run the example!
38.3 KB
Loading
Loading

0 commit comments

Comments
 (0)