@@ -2,3 +2,5 @@
*swp
*swo
.env
+documentation.html
+redoc-static.html
@@ -1,3 +1,5 @@
+pub mod other;
+
pub mod user;
pub mod webhook;
pub mod game;
@@ -0,0 +1,9 @@
+use actix_web::{HttpResponse, get};
+#[get("/documentation")]
+pub async fn route() -> HttpResponse {
+ let content = include_str!("../../../static/documentation.html");
+ HttpResponse::Ok()
+ .content_type("text/html")
+ .body(content)
+}
@@ -0,0 +1 @@
+pub mod documentation;
@@ -66,6 +66,7 @@ async fn main() -> std::io::Result<()> {
})
)
.app_data(web::Data::new(pool.clone()))
+ .configure(routes::other::config)
.configure(routes::user::config)
.configure(routes::webhook::config)
.configure(routes::game::game::config)
@@ -1,3 +1,4 @@
@@ -0,0 +1,8 @@
+use actix_web::web::ServiceConfig;
+use crate::controllers::other::{
+ documentation
+};
+pub fn config(cfg: &mut ServiceConfig) {
+ cfg.service(documentation::route);