mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-11 18:15:39 +00:00
using custom version of actix-codegen and cors for pow routes
This commit is contained in:
@@ -45,6 +45,7 @@ pub mod routes {
|
||||
}
|
||||
|
||||
/// emmits build details of the bninary
|
||||
#[my_codegen::get(path="crate::V1_API_ROUTES.meta.build_details")]
|
||||
async fn build_details() -> impl Responder {
|
||||
let build = BuildDetails {
|
||||
version: VERSION,
|
||||
@@ -60,6 +61,7 @@ pub struct Health {
|
||||
}
|
||||
|
||||
/// checks all components of the system
|
||||
#[my_codegen::get(path="crate::V1_API_ROUTES.meta.health")]
|
||||
async fn health(data: web::Data<Data>) -> impl Responder {
|
||||
use sqlx::Connection;
|
||||
|
||||
@@ -75,16 +77,8 @@ async fn health(data: web::Data<Data>) -> impl Responder {
|
||||
}
|
||||
|
||||
pub fn services(cfg: &mut web::ServiceConfig) {
|
||||
use crate::define_resource;
|
||||
use crate::V1_API_ROUTES;
|
||||
|
||||
define_resource!(
|
||||
cfg,
|
||||
V1_API_ROUTES.meta.build_details,
|
||||
Methods::Get,
|
||||
build_details
|
||||
);
|
||||
define_resource!(cfg, V1_API_ROUTES.meta.health, Methods::Get, health);
|
||||
cfg.service(build_details);
|
||||
cfg.service(health);
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user