mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2024-12-23 08:46:28 +00:00
26 lines
847 B
Rust
26 lines
847 B
Rust
use actix_web::{get, web, HttpResponse, Responder, Scope};
|
|
|
|
use crate::config;
|
|
use crate::status::Status;
|
|
|
|
#[get("/")]
|
|
async fn get_status() -> impl Responder {
|
|
return HttpResponse::Ok().json(Status {
|
|
version: config::VERSION.to_string(),
|
|
max_size: *config::LIMIT as u32,
|
|
max_views: *config::MAX_VIEWS,
|
|
max_expiration: *config::MAX_EXPIRATION,
|
|
allow_advanced: *config::ALLOW_ADVANCED,
|
|
allow_files: *config::ALLOW_FILES,
|
|
theme_new_note_notice: *config::THEME_NEW_NOTE_NOTICE,
|
|
theme_image: config::THEME_IMAGE.to_string(),
|
|
theme_text: config::THEME_TEXT.to_string(),
|
|
theme_page_title: config::THEME_PAGE_TITLE.to_string(),
|
|
theme_favicon: config::THEME_FAVICON.to_string(),
|
|
});
|
|
}
|
|
|
|
pub fn init() -> Scope {
|
|
web::scope("/status").service(get_status)
|
|
}
|