awfully cursed

This commit is contained in:
JMARyA 2024-12-27 00:07:01 +01:00
parent cd10c64a1f
commit 397369ae1e
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
5 changed files with 140 additions and 3 deletions

21
examples/sqlite.rs Normal file
View file

@ -0,0 +1,21 @@
use based::{get_sqlite, get_sqlite_or_create};
use based::request::{RequestContext, StringResponse};
use based::{
get_pg,
page::{Shell, render_page},
};
use maud::html;
use rocket::get;
use rocket::routes;
#[rocket::launch]
async fn launch() -> _ {
// Logging
env_logger::init();
// Database
unsafe { std::env::set_var("DATABASE_URL", "test.db"); }
let db = based::db::Database::new().await;
rocket::build().mount("/", routes![])
}