mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-12 02:25:41 +00:00
OAS: domains
This commit is contained in:
@@ -22,13 +22,20 @@ use serde::{Deserialize, Serialize};
|
||||
use crate::Data;
|
||||
use crate::{GIT_COMMIT_HASH, VERSION};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Builder, Serialize)]
|
||||
pub struct BuildDetails {
|
||||
pub version: &'static str,
|
||||
pub git_commit_hash: &'static str,
|
||||
}
|
||||
|
||||
#[get("/api/v1/meta/build")]
|
||||
/// emmits build details of the bninary
|
||||
pub async fn build_details() -> impl Responder {
|
||||
HttpResponse::Ok().content_type("text/html").body(format!(
|
||||
"version: {}\ncommit: {}",
|
||||
VERSION, *GIT_COMMIT_HASH
|
||||
))
|
||||
let build = BuildDetails {
|
||||
version: VERSION,
|
||||
git_commit_hash: &GIT_COMMIT_HASH,
|
||||
};
|
||||
HttpResponse::Ok().json(build)
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Builder, Serialize)]
|
||||
|
||||
@@ -55,7 +55,6 @@ pub static VERIFICATION_PATH: &str = "mcaptchaVerificationChallenge.json";
|
||||
#[cfg(not(tarpaulin_include))]
|
||||
#[actix_web::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
use actix_web::web;
|
||||
use api::v1;
|
||||
use docs;
|
||||
pretty_env_logger::init();
|
||||
@@ -70,9 +69,6 @@ async fn main() -> std::io::Result<()> {
|
||||
HttpServer::new(move || {
|
||||
let client = Client::default();
|
||||
App::new()
|
||||
.configure(v1::services)
|
||||
.configure(docs::services)
|
||||
//.service(web::resource("/dist/{_:.*}").route(web::get().to(docs::dist)))
|
||||
.wrap(middleware::Logger::default())
|
||||
.wrap(get_identity_service())
|
||||
.wrap(middleware::Compress::default())
|
||||
@@ -81,6 +77,8 @@ async fn main() -> std::io::Result<()> {
|
||||
.wrap(middleware::NormalizePath::new(
|
||||
middleware::normalize::TrailingSlash::Trim,
|
||||
))
|
||||
.configure(v1::services)
|
||||
.configure(docs::services)
|
||||
.app_data(get_json_err())
|
||||
.service(Files::new("/", "./static"))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user