Complete these tasks to reinforce what you learned in this module.
Start an axum server on 127.0.0.1:3000. Add a GET route /health that returns JSON { "status": "ok" }. Use a struct with Serialize and axum::Json. Run with #[tokio::main].
status field and derive Serialize. The handler returns Json(your_struct). Attach the handler to the route with .route("/health", get(handler)).// Task 1: GET /health returning JSON. See tasks/TASKS.md.
fn main() {
todo!("Axum server: GET /health returns JSON status ok. See tasks/TASKS.md");
}
Add a POST route /echo that accepts a JSON body with a field message: String and returns JSON { "echo": "<message>" }. Use Json<Payload> extractor and a response struct. Keep the server on port 3000.
Json extractor for the request body (a struct with message) and return Json with a struct containing echo. Register the handler with post(echo) on the /echo route.// Task 2: POST /echo with JSON body. See tasks/TASKS.md.
fn main() {
todo!("POST /echo: accept a message field, return an echo field. See tasks/TASKS.md");
}