Attribute Macro perseus::main

source ·
#[main]
Expand description

Marks the given function as the universal entrypoint into your app. This is designed for simple use-cases, and the annotated function should return a PerseusApp. This will expand into separate main() functions for both the browser and engine sides.

This should take an argument for the function that will produce your server. In most apps using this macro (which is designed for simple use-cases), this will just be something like perseus_axum::dflt_server (with perseus-warp as a dependency with the dflt-server feature enabled).

Note that the dflt-engine and client-helpers features must be enabled on perseus for this to work. (These are enabled by default.)

Note further that you’ll need to have wasm-bindgen as a dependency to use this.