diff --git a/src/main.rs b/src/main.rs index 81208d9..0177a44 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ use actix_web::{get, post, web, App, HttpResponse, HttpServer, Responder}; use dotenv::dotenv; - +use witl_api::*; #[post("/echo")] async fn echo(req_body: String) -> impl Responder { HttpResponse::Ok().body(req_body) @@ -13,11 +13,12 @@ async fn manual_hello() -> impl Responder { #[actix_web::main] async fn main() -> std::io::Result<()> { dotenv().ok(); + let (port, address) = init_address(); HttpServer::new(|| { App::new() .service(hello) .service(echo) - .route("/hey", web::get().to(manual_hello)) + .app_data(web::Data::new(init_dbpool())) }) .bind(("localhost", 8080))? .run()