This commit is contained in:
Adam 2024-01-30 23:02:22 -05:00
parent b15cff5689
commit 1c3121f8fe
4 changed files with 931 additions and 48 deletions

967
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -5,10 +5,11 @@ edition = "2021"
[dependencies]
app = { path = "../app", default-features = false, features = ["ssr"] }
leptos = { workspace = true, features = [ "ssr" ]}
leptos = { workspace = true, features = ["ssr"] }
leptos_axum.workspace = true
axum.workspace = true
tokio.workspace = true
tower.workspace = true
tower-http.workspace = true
sqlx = { version = "0.7", features = ["runtime-tokio-rustls", "sqlite"] }

6
server/src/db.rs Normal file
View file

@ -0,0 +1,6 @@
use leptos::*;
use sqlx::{Connection, SqliteConnection};
pub async fn db() -> Result<SqliteConnection, ServerFnError> {
Ok(SqliteConnection::connect("sqlite::memory:").await?)
}

View file

@ -5,9 +5,12 @@ use leptos::*;
use leptos_axum::{generate_route_list, LeptosRoutes};
pub mod fileserv;
pub mod db;
#[tokio::main]
async fn main() {
use db::*;
let mut conn = db().await.expect("DB error");
let conf = get_configuration(None).await.unwrap();
let leptos_options = conf.leptos_options;
let addr = leptos_options.site_addr;