https://github.com/afro-coder/spin-rust-demo
This code demo's HTTP requests and responses in rust using Spin from Fermyon. It uses the experimental wasm http library.
https://github.com/afro-coder/spin-rust-demo
Last synced: 11 months ago
JSON representation
This code demo's HTTP requests and responses in rust using Spin from Fermyon. It uses the experimental wasm http library.
- Host: GitHub
- URL: https://github.com/afro-coder/spin-rust-demo
- Owner: afro-coder
- Created: 2022-11-15T06:04:27.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-15T06:22:23.000Z (about 3 years ago)
- Last Synced: 2025-01-23T01:30:27.648Z (about 1 year ago)
- Language: Rust
- Size: 1.95 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## WASM demo in Rust
This project uses Fermyon's [spin](https://github.com/fermyon/spin)
Steps to get started
- Install the Spin binary(Instructions in the Link above), [cargo and rustup](https://doc.rust-lang.org/cargo/getting-started/installation.html)
- Install dependencies
```bash
apt-get install -y curl git libssl-dev pkg-config
```
- Then add wasm as a target
```bash
rustup target add wasm32-wasi
```
- Run `spin build`
- Run `spin up --follow-all` this will show all stdout and stderr
*Note*: There is a Dockerfile but it's currently not optimized and creates a 5GB docker image.
The `spin.toml` is where the Routing is decided for the URL's
Spin has a nice example list
- https://www.fermyon.com/blog/introducing-spin
- https://www.fermyon.com/blog/spin-rest-apis
- https://www.fermyon.com/blog/spin-webhooks