Skip to content

How check own routes before checking leptos ones? #1913

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

You must be logged in to vote

Thanks to the Axum team's I managed to make a solution that seems works well so far:

    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);

The only thing I would've wanted to be able to do is to move pkg path under the /admin but was not able to find the right configuration. With the configuration below I am able to build wasm, js, and CSS in the right folder and I can serve CSS from it, wasm and js files still will have uri /pkg/bundle.js ins…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@gbj
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
2 participants