You've already forked AstralRinth
forked from didirus/AstralRinth
* v3_reroute 404 error * hash change * fixed issue with error conversion * added new model confirmation tests + title name change * renaming, fields * owner; test changes * clippy prepare * fmt * merge fixes * clippy * working merge * revs * merge fixes
15 lines
390 B
Rust
15 lines
390 B
Rust
use crate::routes::{v2_reroute, v3, ApiError};
|
|
use actix_web::{get, web, HttpResponse};
|
|
use sqlx::PgPool;
|
|
|
|
pub fn config(cfg: &mut web::ServiceConfig) {
|
|
cfg.service(get_stats);
|
|
}
|
|
|
|
#[get("statistics")]
|
|
pub async fn get_stats(pool: web::Data<PgPool>) -> Result<HttpResponse, ApiError> {
|
|
v3::statistics::get_stats(pool)
|
|
.await
|
|
.or_else(v2_reroute::flatten_404_error)
|
|
}
|