Add states

This commit is contained in:
Mo 2022-10-29 00:41:49 +02:00
parent 6d388ed61b
commit e860ffa86d

View file

@ -1,15 +1,22 @@
mod captcha_solutions;
mod config;
mod forms;
mod mailer;
mod routes; mod routes;
mod states;
use rocket_dyn_templates::Template; use rocket_dyn_templates::Template;
#[rocket::launch] #[rocket::launch]
fn rocket() -> _ { fn rocket() -> _ {
let config = config::Config::new();
rocket::build() rocket::build()
.mount( .mount(
"/contact-form", &config.path_prefix,
rocket::routes![routes::index, routes::submit, routes::success], rocket::routes![routes::index, routes::submit, routes::success],
) )
.manage(states::SharedCaptchaSolutions::new()) .manage(captcha_solutions::SharedCaptchaSolutions::new())
.manage(mailer::Mailer::new(&config).expect("Failed to create mailer!"))
.manage(config)
.attach(Template::fairing()) .attach(Template::fairing())
} }