pub fn handler(
    config: config::Config,
    projects: Vec<Project>,
    connection_pool: ConnectionPool,
) -> Result<Box<dyn Handler>> {
    let mut chain = Chain::new(get_router());

    chain.link_before(persistent::Read::<Config>::one(config));
    chain.link_before(persistent::Read::<Projects>::one(projects));
    chain.link_before(persistent::Read::<DatabaseConnectionPool>::one(
        connection_pool,
    ));

    chain.link_after(ErrorHandler);
    chain.link_after(initialize_templates("./templates/", ".hbs")?);
    chain.link_after(ErrorReporter);

    let mount = mount(chain);
    Ok(Box::new(mount))
}
/// Returns the main route handler for the website.
///
/// This handler contains a number of middleware:
///   - Routing for all page requests
///   - Routing for static files
///   - Persistence for the website configuration
///   - Rendering handlebars templates
///   - Error reporting
///   - Error handling
Returns the main route handler for the website.
This handler contains a number of middleware:
Routing for all page requests
Routing for static files
Persistence for the website configuration
Rendering handlebars templates
Error reporting
Error handling
Returns the main route handler for the website . This handler contains a number of middleware : Routing for all page requests Routing for static files Persistence for the website configuration Rendering handlebars templates Error reporting Error handling
pub fn handler(
    config: config::Config,
    projects: Vec<Project>,
    connection_pool: ConnectionPool,
) -> Result<Box<dyn Handler>> {
    let mut chain = Chain::new(get_router());
    chain.link_before(persistent::Read::<Config>::one(config));
    chain.link_before(persistent::Read::<Projects>::one(projects));
    chain.link_before(persistent::Read::<DatabaseConnectionPool>::one(
        connection_pool,
    ));
    chain.link_after(ErrorHandler);
    chain.link_after(initialize_templates("./templates/", ".hbs")?);
    chain.link_after(ErrorReporter);
    let mount = mount(chain);
    Ok(Box::new(mount))
}
pub fn handler ( config : config :: Config , projects : Vec < Project > , connection_pool : ConnectionPool , ) -> Result < Box < dyn Handler > > { let mut chain = Chain :: new ( get_router ( ) ) ; chain . link_before ( persistent :: Read :: < Config > :: one ( config ) ) ; chain . link_before ( persistent :: Read :: < Projects > :: one ( projects ) ) ; chain . link_before ( persistent :: Read :: < DatabaseConnectionPool > :: one ( connection_pool , ) ) ; chain . link_after ( ErrorHandler ) ; chain . link_after ( initialize_templates ( " " , " " ) ? ) ; chain . link_after ( ErrorReporter ) ; let mount = mount ( chain ) ; Ok ( Box :: new ( mount ) ) }
Returns the main route handler for the website.
Returns the main route handler for the website .
config
config::Config
projects
Vec<Project>
connection_pool
ConnectionPool
config
config::Config
projects
Vec<Project>
connection_pool
ConnectionPool