summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorWriterV2 <primary-v2@protonmail.com>2026-03-21 11:56:19 +0100
committerWriterV2 <primary-v2@protonmail.com>2026-03-21 11:56:19 +0100
commitf491ed95a3bc82c31c70b0f38ed841408576ec0c (patch)
tree1cfc9a957e150ded75c93fad54028a18640ba7c2 /src/main.rs
parent74db93c431ebc02b1dc43ec12714007d005a9704 (diff)
Purge + prepare for local website builder
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs36
1 files changed, 0 insertions, 36 deletions
diff --git a/src/main.rs b/src/main.rs
deleted file mode 100644
index dfe1447..0000000
--- a/src/main.rs
+++ /dev/null
@@ -1,36 +0,0 @@
-use std::env;
-
-use dotenvy::dotenv;
-use sqlx::sqlite::SqlitePoolOptions;
-
-use self::db::story;
-
-pub mod db;
-mod error;
-mod handlers;
-
-#[tokio::main]
-async fn main() {
- dotenv().ok();
- let db_url =
- &env::var("DATABASE_URL").expect("Failed to get environment variable DATABASE_URL");
-
- let pool = SqlitePoolOptions::new()
- .connect(db_url)
- .await
- .expect("Failed to connect to database");
-
- sqlx::migrate!()
- .run(&pool)
- .await
- .expect("Failed to run migrations");
-
- story::synchronize_story_files(&pool)
- .await
- .expect("Failed to synchronize files");
-
- let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap();
- axum::serve(listener, handlers::router(pool).await.into_make_service())
- .await
- .unwrap();
-}