kvarn_extensions

Function mount_all

source
pub fn mount_all(extensions: &mut Extensions)
Expand description

Mounts all extensions specified in Cargo.toml dependency declaration. The extensions listed below will always get included in your server after calling this function.

The current defaults are:

To add PHP, use php().

The push extension uses the default settings.

ยงExamples

use kvarn::prelude::*;
let mut extensions = Extensions::new();
kvarn_extensions::mount_all(&mut extensions);

let host = Host::unsecure("localhost", "web", Extensions::default(), host::Options::default());
let data = HostCollection::builder().insert(host).build();
let port_descriptor = PortDescriptor::new(8080, data);

let shutdown_manager = run_config![port_descriptor].execute().await;
shutdown_manager.wait().await;