Install Rust using https://rustup.rs/.
Clone this repo and run the starter app:
git clone https://github.com/fromscratchcode/rust-api-workshop.git
cd rust-api-workshop/starter
cargo runThe starter directory contains the minimal version we’ll build from. The completed version lives in the solution directory.
In a separate shell, verify the server is running:
curl http://localhost:7878/healthYou should see:
{"status": "OK"}We'll start from a minimal Axum server and progressively implement each of these routes.
GET /usersPOST /usersGET /users/{id}PUT /users/{id}DELETE /users/{id}
cargo new rest-api
cd rest-api
cargo add axum
cargo add tokio --features full
cargo add serde --features derive
cargo add serde_jsonThe software is granted under the terms of the MIT License. For details see the file LICENSE included with the source distribution. All copyrights are owned by their respective authors.