zipity 0.0.1-alpha.2

A markdown-based micro web framework built in Rust
1
2
3
4
5
6
7
8
9
10
11
12
13
// Example: http://localhost:8080/api/users

use serde_json::json;

pub async fn users() -> impl Responder {
    let users = vec![
        json!({"id": 1, "name": "John"}),
        json!({"id": 2, "name": "Jane"}),
        json!({"id": 3, "name": "Alice"})
    ];

    HttpResponse::Ok().json(users)
}