summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorLibravatar cel 🌸 <cel@blos.sm>2023-12-12 18:20:56 +0000
committerLibravatar cel 🌸 <cel@blos.sm>2023-12-12 18:20:56 +0000
commita587459a1817c0fc57b46df3f9c69567e1e775b7 (patch)
treeab99c6aaa7c2b3245c83db6332e4ca54006831b3 /src/main.rs
parent370a25e5a0cbb95e2aa1cec55305b22aeaf99aa0 (diff)
downloadpinussy-a587459a1817c0fc57b46df3f9c69567e1e775b7.tar.gz
pinussy-a587459a1817c0fc57b46df3f9c69567e1e775b7.tar.bz2
pinussy-a587459a1817c0fc57b46df3f9c69567e1e775b7.zip
refactor: separate model and controller
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index 6a439ec..a488835 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -6,6 +6,7 @@ use actix_web::middleware::ErrorHandlers;
use actix_web::{web, App, HttpServer};
use sqlx::postgres::PgPoolOptions;
+use pinussy::db::Database;
use pinussy::routes;
use pinussy::Pinussy;
@@ -19,7 +20,9 @@ async fn main() -> std::io::Result<()> {
sqlx::migrate!("./migrations").run(&pool).await.unwrap();
- let pinussy = Pinussy { db: pool };
+ let pinussy = Pinussy {
+ db: Database::new(pool),
+ };
HttpServer::new(move || {
App::new()