teo 0.0.52-beta.3

REDEFINED HTTP server framework.
Documentation
1
2
3
4
5
6
7
8
9
10
use actix_web::http::StatusCode;
use actix_web::{HttpResponse, HttpResponseBuilder};
use serde_json::json;
use crate::core::error::Error;

impl Into<HttpResponse> for Error {
    fn into(self) -> HttpResponse {
        HttpResponseBuilder::new(StatusCode::from_u16(self.r#type.code()).unwrap()).json(json!({"error": self}))
    }
}