diff --git a/server/src/main.rs b/server/src/main.rs index d24f79a..e32075a 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -5,7 +5,7 @@ extern crate base64; use std::net::SocketAddr; use std::convert::Infallible; // our main dispatcher basically never fails hence why we use this -use std::env::var; +use std::env; use std::collections::HashMap; use tokio; @@ -13,12 +13,14 @@ use hyper::{ self, Server, Response, Request, Body, - Method, + Method, StatusCode, service::{make_service_fn, service_fn} }; +use mysql_async::Conn; use dotenv::dotenv; mod auth; +use auth::AuthReason; fn map_qs(query_string_raw: Option<&str>) -> HashMap<&str, &str> { /* @@ -38,7 +40,7 @@ fn map_qs(query_string_raw: Option<&str>) -> HashMap<&str, &str> { map } -async fn route_dispatcher(resp: &Response
, meth: &Method, path: &str, params: &HashMap<&str, Option<&str>>) { +async fn route_dispatcher(resp: &Response, meth: &Method, path: &str, params: &HashMap<&str, &str>) { // we do have to handle some general hyper errors unimplemented!() } @@ -49,12 +51,17 @@ async fn main_responder(request: Request) -> Result