From b7a2265e9b29d8fa09f84f5213ef7f8ed3045ca6 Mon Sep 17 00:00:00 2001 From: cel 🌸 Date: Wed, 13 Nov 2024 20:00:15 +0000 Subject: initial commit --- src/lib.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/lib.rs (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..fc2ab75 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,28 @@ +use config::Config; +use db::Database; + +mod artist; +mod artwork; +mod comment; +pub mod config; +mod db; +mod error; +mod file; +pub mod routes; +mod ructe_poem; + +pub type Result = std::result::Result; + +#[derive(Clone)] +pub struct Critch { + db: Database, + config: Config, +} + +impl Critch { + pub async fn new(config: Config) -> Self { + let db = Database::new(config.database_connection()).await; + + Self { db, config } + } +} -- cgit