82 releases

new 0.7.3 Jan 4, 2025
0.7.2 Dec 21, 2024
0.7.0 Nov 30, 2024
0.7.0-preview2 Apr 29, 2024
0.0.2 Nov 28, 2022

#2144 in Web programming

Download history 2716/week @ 2024-09-20 2886/week @ 2024-09-27 2734/week @ 2024-10-04 3242/week @ 2024-10-11 3690/week @ 2024-10-18 3428/week @ 2024-10-25 3379/week @ 2024-11-01 2347/week @ 2024-11-08 2677/week @ 2024-11-15 2933/week @ 2024-11-22 3430/week @ 2024-11-29 4210/week @ 2024-12-06 4767/week @ 2024-12-13 2402/week @ 2024-12-20 2004/week @ 2024-12-27 3258/week @ 2025-01-03

13,336 downloads per month
Used in 12 crates (10 directly)

MIT license

1MB
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

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–44MB
~758K SLoC