feat: bootstrap htmx templating system

This commit is contained in:
Jef Roosens 2025-03-29 21:26:06 +01:00
parent ad015b47e4
commit b3e49be299
No known key found for this signature in database
GPG key ID: 21FD3D77D56BAF49
10 changed files with 210 additions and 2 deletions

View file

@ -1,4 +1,4 @@
use std::time::Duration;
use std::{sync::Arc, time::Duration};
use crate::server;
@ -9,12 +9,17 @@ pub fn serve(config: &crate::config::Config) -> u8 {
tracing::info!("Initializing database and running migrations");
// TODO remove unwraps
let store =
gpodder_sqlite::SqliteRepository::from_path(config.data_dir.join(crate::DB_FILENAME))
.unwrap();
let tera = crate::web::initialize_tera().unwrap();
let store = gpodder::GpodderRepository::new(store);
let ctx = server::Context { store };
let ctx = server::Context {
store,
tera: Arc::new(tera),
};
let app = server::app(ctx.clone());
let rt = tokio::runtime::Builder::new_multi_thread()