Skip to main content

app_main

Function app_main 

Source
pub fn app_main(
    app_components: AppComponents<'_>,
    switches: AppSwitches,
) -> RUMResult<()>
Expand description

Main API function for running and serving the web application.

It takes an AppComponents instance and a few switches to help preconfigure the framework to use custom-made components and to register API endpoints.

See rumtk_web_run_app for more details.

ยงExample

use rumtk_web::app_main;
use rumtk_web::{rumtk_web_register_app_switches, rumtk_web_register_app_components};

// We pass true to the switches because we do not want the web server to actually serve the page
// It would hang the test otherwise...
app_main(
    rumtk_web_register_app_components!(),
    rumtk_web_register_app_switches!(true)
).expect("Issue occurred while running the app");