awfully cursed
This commit is contained in:
parent
cd10c64a1f
commit
397369ae1e
5 changed files with 140 additions and 3 deletions
21
examples/sqlite.rs
Normal file
21
examples/sqlite.rs
Normal 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![])
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue