Closed blowback closed 8 months ago
In server/main.rs I changed:
.leptos_routes(&leptos_options, routes, App)
to
.leptos_routes(&state, routes, App)
and that seems to have fixeded it. I tihnk i grasp why, but I lack the rust words to explain it ;)
I am trying to modify a start-axum-workspace project to use Postgres, so I need to pass a connection pool around. I tried to follow the Axum Substate technique (as demonstrated in the session_auth_axum example) but I always get this error:
I added a server/state.rs:
and modified server/main.rs:
and modified server/fileserv.js:
I also tried making file_and_error_handler() take
State(state): State<AppState>
and got a different error:I'm sure I'm missing something terribly obvious...any clue gratefully received!
(I am following rustonnails.com, but swapping out Dioxus for Leptos.)