mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2026-04-02 18:05:23 +00:00
add config for max views, expiration and advanced
This commit is contained in:
@@ -1,25 +1,12 @@
|
||||
use actix_web::{get, web, HttpResponse, Responder};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use actix_web::web;
|
||||
|
||||
use crate::note;
|
||||
use crate::size::LIMIT;
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
struct Status {
|
||||
version: String,
|
||||
max_size: usize,
|
||||
}
|
||||
|
||||
#[get("/status")]
|
||||
async fn status() -> impl Responder {
|
||||
return HttpResponse::Ok().json(Status {
|
||||
version: option_env!("CARGO_PKG_VERSION")
|
||||
.unwrap_or("Unknown")
|
||||
.to_string(),
|
||||
max_size: *LIMIT,
|
||||
});
|
||||
}
|
||||
use crate::status;
|
||||
|
||||
pub fn init(cfg: &mut web::ServiceConfig) {
|
||||
cfg.service(web::scope("/api").service(note::service()).service(status));
|
||||
cfg.service(
|
||||
web::scope("/api")
|
||||
.service(note::init())
|
||||
.service(status::init()),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user