mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew
synced 2026-08-26 15:02:18 +08:00
16 lines
366 B
Rust
16 lines
366 B
Rust
use jzon::object;
|
|
use actix_web::{web, HttpRequest, Responder};
|
|
|
|
use crate::router::{global, Body};
|
|
|
|
pub fn routes(cfg: &mut web::ServiceConfig) {
|
|
cfg.route("/debug/error", web::post().to(error));
|
|
}
|
|
|
|
async fn error(req: HttpRequest, Body(body): Body) -> impl Responder {
|
|
|
|
println!("client error: {}", body["code"]);
|
|
|
|
global::api(&req, Some(object!{}))
|
|
}
|