/// Routers look funny, so no point defining as a struct
Routers look funny, so no point defining as a struct
Routers look funny so no point defining as a struct
fn serialize_router(site: &Site, settings: &Settings) -> Value {
    let mut router = json!({
        "rule": format!("Host(`{}`)", site.get_hostname()),
        "service": &settings.traefik_service,
        "middlewares": [DEFAULT_MIDDLEWARE_NAME]
    });
    if let Some(cert_resolver) = &settings.traefik_cert_resolver {
        router.as_object_mut().unwrap().insert(
            String::from("tls"),
            json!({ "certResolver": cert_resolver }),
        );
    }
    router
}
fn serialize_router ( site : & Site , settings : & Settings ) -> Value { let mut router = json ! ( { " " format ( " " site get_hostname ( ) ) " " settings traefik_service " " [ DEFAULT_MIDDLEWARE_NAME ] } ) ; if let Some ( cert_resolver ) = & settings . traefik_cert_resolver { router . as_object_mut ( ) . unwrap ( ) . insert ( String :: from ( " " ) , json ! ( { " " cert_resolver } ) , ) ; } router }
Routers look funny, so no point defining as a struct
Routers look funny so no point defining as a struct
site
&Site
settings
&Settings