Skip to content

How to handle * route and which can return response or pass control to the next route #2276

Answered by Umenokin
Umenokin asked this question in Q&A
Discussion options

You must be logged in to vote

Thank you very much @davidpdrsn, @jplatte.
It seems I managed to make a solution that works well for now:

let app = Router::new()
        .route("/*path", any(|| async { Html("Hello, World!") }))
        .route("/pkg/*path", get(handle_static_files))
        .route("/admin/assets/*path", get(handle_static_files))
        .leptos_routes(&leptos_options, routes, App)
        .with_state(leptos_options);

I would've wanted to move pkg under admin for consistency but this is purely a leptos configuration.

Thanks a lot!

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@Umenokin
Comment options

@jplatte
Comment options

@davidpdrsn
Comment options

@Umenokin
Comment options

Answer selected by Umenokin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants