From 5536f9638a5f69b9aa5e1de64365e5db9d596c27 Mon Sep 17 00:00:00 2001 From: Edward Shen Date: Thu, 27 May 2021 17:05:50 -0400 Subject: [PATCH] Add index page --- src/index.html | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/main.rs | 1 + src/routes.rs | 5 +++++ 3 files changed, 50 insertions(+) create mode 100644 src/index.html diff --git a/src/index.html b/src/index.html new file mode 100644 index 0000000..4703cdb --- /dev/null +++ b/src/index.html @@ -0,0 +1,44 @@ + + + + + + + + + + MangaDex@Home + + + + + MangaDex +
+

Content Delivery Node

+

+ This MangaDex@Home + node is part of the MangaDex Network + content delivery and caching network.

+

Please report DMCA inquiries only to our dedicated agent.

+ + + \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index d15086d..714e43d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -190,6 +190,7 @@ async fn main() -> Result<(), Box> { // Start HTTPS server let server = HttpServer::new(move || { App::new() + .service(routes::index) .service(routes::token_data) .service(routes::token_data_saver) .service(routes::metrics) diff --git a/src/routes.rs b/src/routes.rs index c7eeca3..e1728c4 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -60,6 +60,11 @@ impl Responder for ServerResponse { } } +#[get("/")] +async fn index() -> impl Responder { + HttpResponse::Ok().body(include_str!("index.html")) +} + #[allow(clippy::future_not_send)] #[get("/{token}/data/{chapter_hash}/{file_name}")] async fn token_data(