Skip to content

logankeenan/axum-wasm-macros

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

axum-wasm-macros

Crates.io

A macro to ensure async axum routes can compile to WASM

Why?

Axum handlers return a Send future. However, JS types do not return a Send future. wasm_compat will provide compatability between the return types.

Example

use axum_wasm_macros::wasm_compat;
use axum::Router;
use axum::routing::get;

#[wasm_compat]
pub async fn index() -> &'static str {
    "Hello World"
}

pub fn main() {
    let router: Router = Router::new().route("/", get(index));
    // rest of the app code goes here.
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages