diff --git a/src/main.rs b/src/main.rs index 955b8bf..f59c6a1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,15 +1,22 @@ +mod captcha_solutions; +mod config; +mod forms; +mod mailer; mod routes; -mod states; use rocket_dyn_templates::Template; #[rocket::launch] fn rocket() -> _ { + let config = config::Config::new(); + rocket::build() .mount( - "/contact-form", + &config.path_prefix, 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()) }