bolt-web 0.2.6

⚡ A high-performance, minimalist web framework for Rust, inspired by Express.js and Gin.
Documentation
1
2
3
4
5
6
7
8
9
10
11
use serde_json::json;

use crate::{bolt_error_handler, response::ResponseWriter};

async fn default(msg: String, res: &mut ResponseWriter) {
    let status = res.status;
    res.status(status)
        .json(&json!({ "error": msg, "status" : status }));
}

bolt_error_handler!(default);