A Simple Todolist API in Rust and Actix Web! This API allows you to manage a todo list, including creating, reading, updating, and deleting tasks. It is built using Rust, Actix-web, and MongoDB.
- Create a new todo item
- Retrieve all todo items
- Retrieve a single todo item by ID
- Update a todo item by ID
- Delete a todo item by ID
- Rust (latest stable version)
- MongoDB (running instance)
- Cargo (Rust package manager)
git clone https://github.com/FeezyHendrix/rust-actix-mongodb.git
cd rust-actix-mongodb
Ensure you have MongoDB installed and running. You can find installation instructions here.
-
Install Rust dependencies:
cargo build
-
Run the API:
cargo run
The API will be available at https://localhost:8080
.
- URL:
/todos
- Method:
POST
- Request Body:
{ "content": "Your todo content", "is_done": false }
- Response:
{ "message": "Successful" }
- URL:
/todos
- Method:
GET
- Response:
[ { "content": "Your todo content", "is_done": false }, ... ]
- URL:
/todos/{id}
- Method:
GET
- Response:
{ "content": "Your todo content", "is_done": false }
- URL:
/todos/{id}
- Method:
PUT
- Request Body:
{ "content": "Updated content", "is_done": true }
- Response:
{ "message": "Updated Successfully" }
- URL:
/todos/{id}
- Method:
DELETE
- Response:
{ "message": "Todo item deleted successfully" }