pub fn vertigo_install(cfg: &mut ServiceConfig, mount_config: &MountConfig)Expand description
Install vertigo handler and static files based on mount config.
The handler can work only if ServerState is initialized before. This can’t be done automatically because initialization compiles the WASM which takes some time
Example:
use actix_web::{web, App};
use vertigo_cli::serve::{MountConfigBuilder, ServerState, vertigo_install};
let mount_config = MountConfigBuilder::new("/", "./build").build().unwrap();
ServerState::init(&mount_config).unwrap();
let app = App::new();
app.configure(|srvc| vertigo_install(srvc, &mount_config));To bootstrap a project using this method, use fullstack template; run:
vertigo-cli new -t fullstack my_project