https://github.com/oxide-byte/todo-wasi
Todo WASI/WebAssmbly Rest/API Server with Postgres Database
https://github.com/oxide-byte/todo-wasi
rest-api rust wasi wasmedge
Last synced: about 2 months ago
JSON representation
Todo WASI/WebAssmbly Rest/API Server with Postgres Database
- Host: GitHub
- URL: https://github.com/oxide-byte/todo-wasi
- Owner: oxide-byte
- Created: 2024-09-30T21:50:37.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2025-01-22T17:36:29.000Z (4 months ago)
- Last Synced: 2025-02-01T23:39:44.279Z (4 months ago)
- Topics: rest-api, rust, wasi, wasmedge
- Language: Rust
- Homepage:
- Size: 16.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Todo WASI
## Introduction
This Repository is a little POC on experimenting with WebAssembly/WASI on Backend side.
Due some great experiences with Leptos (WebAssembly/Frontend), this POC contains a Rest API Server based on minimal dependencies, storing data in a Postgres DB. The code itself does not contain a lot off error checks, validations or security gates.
The Docker image of the Web Server is based on *wasmedge/slim:0.13.5* with a total size of 64.26 MB.
The WebAssembly Server size build on release is 2 MB.
## Execution
The application can build and run inside Docker as Docker composition with:
````shell
docker compose up
````In case you have a Rust development environment with cargo configured for build a target WASI:
````shell
cargo build --target wasm32-wasip1
````or for the release mode:
````shell
cargo build --target wasm32-wasip1 --profile release
````The Server itself can be started when you have installed wasmedge with:
````shell
chmod +x target/wasm32-wasip1/debug/todo-wasi.wasm
wasmedge target/wasm32-wasip1/debug/todo-wasi.wasm
````In case you have IntelliJ, you can execute the HTTP requests found in the folder /http
like````http request
GET http://127.0.0.1:8080/api/todo
Accept: application/json
````