summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2021-03-16 11:22:42 +0100
committerGitHub <noreply@github.com>2021-03-16 11:22:42 +0100
commitb950072a3109d2c13881611a3950baa191caf097 (patch)
treeccfc5c2c26c56a496d0f34b3f4db0965c713e7bb /src/main.rs
parent48a9ac895b6e8b01622810ec4bf2f3a423426ca3 (diff)
parent6350610ef5f7d73680853d39898094f2bf15febb (diff)
Merge pull request #11 from gico-net/feat/add-repositories
Add CRUD for repository
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs17
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()