Skip to content

About

A simple in-memory REST API for managing movies, built with Rust and Axum.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

83 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Movies

GitHub Workflow Status

A simple REST API for managing movies, built with Rust and Axum.

Tech Stack

  • Rust (Edition 2024)
  • Axum - Web framework
  • Tokio - Async runtime
  • Serde - Serialization/deserialization

API Endpoints

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

Create 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

List All Movies

GET /movie

Response: 200 OK with array of movies

Get a Movie

GET /movie/{id}

Response: 200 OK with movie, or 404 Not Found

Update a Movie

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 a Movie

DELETE /movie/{id}

Response: 204 No Content, or 404 Not Found

Running

cargo run

The server starts at http://127.0.0.1:3000.

Development

# Check code
cargo check

# Run linter
cargo clippy

# Format code
cargo fmt

About

A simple in-memory REST API for managing movies, built with Rust and Axum.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages