index page

This commit is contained in:
Brandon Thomas committed 2021-05-20 00:07:40 -04:00
1 parent 793fd30c79
commit 1979d604b0
4 files changed
+15

No files matched your search

Generated
+1
View File
@@ -2455,6 +2455,7 @@ dependencies = [
"bitflags",
"byteorder",
"bytes 1.0.1",
"chrono",
"crc",
"crossbeam-channel",
"crossbeam-queue",
+1
View File
@@ -1 +1,2 @@
pub mod root_index;
pub mod users;
+11
View File
@@ -0,0 +1,11 @@
use actix_http::http::StatusCode;
use actix_web::{HttpResponse, HttpRequest, Responder, get};
use log::info;
#[get("/")]
pub async fn get_root_index() -> impl Responder {
info!("GET /");
HttpResponse::build(StatusCode::OK)
.content_type("text/html; charset=utf-8")
.body("<h1>hello friend</h1>")
}
+2
View File
@@ -28,6 +28,7 @@ use crate::util::cookies::CookieManager;
use crate::endpoints::users::logout::logout_handler;
use crate::util::session_checker::SessionChecker;
use crate::endpoints::users::session_info::session_info_handler;
use crate::endpoints::root_index::get_root_index;
const DEFAULT_BIND_ADDRESS : &'static str = "0.0.0.0:12345";
const DEFAULT_RUST_LOG: &'static str = "debug,actix_web=info";
@@ -156,6 +157,7 @@ pub async fn serve(server_state: ServerState) -> AnyhowResult<()>
.route(web::get().to(session_info_handler))
.route(web::head().to(|| HttpResponse::Ok()))
)
.service(get_root_index)
})
.bind(bind_address)?
.workers(num_workers)