Compare commits

...

2 commits

Author SHA1 Message Date
Adam
1c3121f8fe add db 2024-01-30 23:02:22 -05:00
Adam
b15cff5689 let serde be serde 2024-01-30 23:01:42 -05:00
5 changed files with 932 additions and 49 deletions

967
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -11,7 +11,7 @@ leptos_axum = { workspace = true, optional = true }
http.workspace = true
thiserror.workspace = true
serde = "1.0.195"
serde = { version = "1"}
femark = { version = "0.1.5", optional = true }
toml = { version = "0.8.8", optional = true }

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;