A simple REST API todo server built with Rust and Actix Web.
- Create, read, update, and delete todos
- In-memory storage (data is lost when server restarts)
- JSON API responses
- Health check endpoint
src/main.rs- Main application entry point, server setup, and data structuressrc/routes.rs- HTTP route handlers for all API endpoints
- Make sure you have Rust installed
- Clone this repository
- Run the server:
cargo runThe server will start on http://localhost:8080
GET /- Returns server status
GET /api/todos- Get all todosPOST /api/todos- Create a new todoGET /api/todos/{id}- Get a specific todo by IDPUT /api/todos/{id}- Update a todoDELETE /api/todos/{id}- Delete a todo
curl -X POST http://localhost:8080/api/todos \
-H "Content-Type: application/json" \
-d '{"title": "Learn Rust"}'curl http://localhost:8080/api/todoscurl -X PUT http://localhost:8080/api/todos/{id} \
-H "Content-Type: application/json" \
-d '{"title": "Learn Rust Advanced", "completed": true}'curl -X DELETE http://localhost:8080/api/todos/{id}actix-web- Web frameworktokio- Async runtimeserde- Serialization/deserializationserde_json- JSON supportuuid- UUID generationenv_logger- Logging
