77 releases

new 0.7.0-rc2 Nov 22, 2024
0.7.0-rc0 Oct 22, 2024
0.7.0-preview2 Apr 29, 2024
0.6.9 Mar 4, 2024
0.0.2 Nov 28, 2022

#1982 in Web programming

Download history 2381/week @ 2024-08-04 3045/week @ 2024-08-11 2691/week @ 2024-08-18 2351/week @ 2024-08-25 2480/week @ 2024-09-01 2769/week @ 2024-09-08 2127/week @ 2024-09-15 2806/week @ 2024-09-22 2899/week @ 2024-09-29 2809/week @ 2024-10-06 3380/week @ 2024-10-13 3676/week @ 2024-10-20 3239/week @ 2024-10-27 3379/week @ 2024-11-03 2340/week @ 2024-11-10 2770/week @ 2024-11-17

12,015 downloads per month
Used in 11 crates (9 directly)

MIT license

795KB
16K SLoC

Provides functions to easily integrate Leptos with Axum.

JS Fetch Integration

The leptos_axum integration supports running in JavaScript-hosted WebAssembly runtimes, e.g., running inside Deno, Cloudflare Workers, or other JS environments. To run in this environment, you need to disable the default feature set and enable the wasm feature on leptos_axum in your Cargo.toml.

leptos_axum = { version = "0.6.0", default-features = false, features = ["wasm"] }

Features

  • default: supports running in a typical native Tokio/Axum environment
  • wasm: with default-features = false, supports running in a JS Fetch-based environment
  • islands: activates Leptos islands mode

Important Note

Prior to 0.5, using default-features = false on leptos_axum simply did nothing. Now, it actively disables features necessary to support the normal native/Tokio runtime environment we create. This can generate errors like the following, which don’t point to an obvious culprit: spawn_localcalled from outside of atask::LocalSet If you are not using the wasm feature, do not set default-features = false on this package.

More information

For more details on how to use the integrations, see the examples directory in the Leptos repository.

Dependencies

~30–43MB
~758K SLoC