diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/main.rs b/src/main.rs index 0b3d67f..2c5532a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,17 +1,16 @@ mod config; +mod db; +mod errors; +mod helpers; -use actix_web::{middleware, web, App, HttpServer}; +mod repository; + +use actix_web::{middleware, App, HttpServer}; use dotenv::dotenv; use slog::info; use tokio_postgres::NoTls; -use crate::config::{Config, AppState}; - -async fn index(state: web::Data<AppState>) -> &'static str { - info!(state.log, "GET `/` page"); - - "Hello from Rust!" -} +use crate::config::{AppState, Config}; #[actix_rt::main] async fn main() -> std::io::Result<()> { @@ -35,7 +34,7 @@ async fn main() -> std::io::Result<()> { log: log.clone(), }) .wrap(middleware::Logger::default()) - .route("/", web::get().to(index)) + .configure(repository::routes::config) }) .bind(format!("{}:{}", config.server.host, config.server.port))? .run() |