mirror of
https://codeberg.org/selfsigned-ash/antifed
synced 2026-07-21 18:49:34 +02:00
💥 Nukes rust and replaces with kotlin
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
mod db;
|
||||
mod auth;
|
||||
|
||||
use dotenv;
|
||||
use auth::ApiKey;
|
||||
|
||||
#[macro_use]
|
||||
extern crate rocket;
|
||||
|
||||
#[get("/")]
|
||||
async fn index() -> &'static str {
|
||||
"Hello World!"
|
||||
}
|
||||
|
||||
#[get("/hi")]
|
||||
async fn hello(api_key: ApiKey) -> &'static str {
|
||||
"Hi!"
|
||||
}
|
||||
|
||||
#[launch]
|
||||
fn rocket() -> _ {
|
||||
dotenv::dotenv().ok();
|
||||
let db_path = dotenv::var("DB_PATH").expect("DB_PATH is not set");
|
||||
dotenv::var("API_KEY").expect("API_KEY is not set");
|
||||
let db = db::Conn::new(&db_path);
|
||||
|
||||
rocket::build().mount("/", routes![index, hello])
|
||||
}
|
||||
Reference in New Issue
Block a user