A simple REST API for managing movies, built with Rust and Axum.
- Rust (Edition 2024)
- Axum - Web framework
- Tokio - Async runtime
- Serde - Serialization/deserialization
| Method | Endpoint | Description |
|---|---|---|
| GET | /movie |
List all movies |
| POST | /movie |
Create a movie |
| GET | /movie/{id} |
Get a movie by ID |
| PUT | /movie/{id} |
Update a movie |
| DELETE | /movie/{id} |
Delete a movie |
POST /movie
Content-Type: application/json
{
"id": "1",
"name": "The Shawshank Redemption",
"year": 1994,
"was_good": true
}Response: 201 Created with created movie
GET /movieResponse: 200 OK with array of movies
GET /movie/{id}Response: 200 OK with movie, or 404 Not Found
PUT /movie/{id}
Content-Type: application/json
{
"id": "1",
"name": "Updated Name",
"year": 1994,
"was_good": true
}Response: 200 OK with updated movie, or 404 Not Found
DELETE /movie/{id}Response: 204 No Content, or 404 Not Found
cargo runThe server starts at http://127.0.0.1:3000.
# Check code
cargo check
# Run linter
cargo clippy
# Format code
cargo fmt