mirror of
https://codeberg.org/selfsigned-ash/antifed
synced 2026-07-22 02:59:33 +02:00
⚡ Adds rusqlite and dotenv
This commit is contained in:
+10
-1
@@ -1,4 +1,9 @@
|
||||
#[macro_use] extern crate rocket;
|
||||
mod db;
|
||||
|
||||
use dotenv;
|
||||
|
||||
#[macro_use]
|
||||
extern crate rocket;
|
||||
|
||||
#[get("/")]
|
||||
async fn index() -> &'static str {
|
||||
@@ -7,5 +12,9 @@ async fn index() -> &'static str {
|
||||
|
||||
#[launch]
|
||||
fn rocket() -> _ {
|
||||
dotenv::dotenv().ok();
|
||||
let db_path = dotenv::var("DB_PATH").expect("DB_PATH is not set");
|
||||
let db = db::new_conn(&db_path);
|
||||
|
||||
rocket::build().mount("/", routes![index])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user