2022-03-01 14:24:17 +00:00
|
|
|
use actix_web::{get, web, HttpResponse, Responder, Scope};
|
|
|
|
|
|
|
|
use crate::config;
|
|
|
|
use crate::status::Status;
|
|
|
|
|
|
|
|
#[get("/")]
|
|
|
|
async fn get_status() -> impl Responder {
|
2022-03-12 13:07:33 +00:00
|
|
|
return HttpResponse::Ok().json(Status {
|
|
|
|
version: config::VERSION.to_string(),
|
2022-07-16 12:16:54 +00:00
|
|
|
max_size: *config::LIMIT as u32,
|
2022-03-12 13:07:33 +00:00
|
|
|
max_views: *config::MAX_VIEWS,
|
|
|
|
max_expiration: *config::MAX_EXPIRATION,
|
|
|
|
allow_advanced: *config::ALLOW_ADVANCED,
|
2024-03-15 14:14:17 +00:00
|
|
|
allow_files: *config::ALLOW_FILES,
|
2022-07-16 12:16:54 +00:00
|
|
|
theme_image: config::THEME_IMAGE.to_string(),
|
|
|
|
theme_text: config::THEME_TEXT.to_string(),
|
2022-10-27 15:26:56 +00:00
|
|
|
theme_page_title: config::THEME_PAGE_TITLE.to_string(),
|
2024-03-15 14:14:17 +00:00
|
|
|
theme_favicon: config::THEME_FAVICON.to_string(),
|
2022-03-12 13:07:33 +00:00
|
|
|
});
|
2022-03-01 14:24:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn init() -> Scope {
|
2022-03-12 13:07:33 +00:00
|
|
|
web::scope("/status").service(get_status)
|
2022-03-01 14:24:17 +00:00
|
|
|
}
|