contact-form/src/main.rs

23 lines
560 B
Rust
Raw Normal View History

2022-10-28 22:41:49 +00:00
mod captcha_solutions;
mod config;
mod forms;
mod mailer;
2022-10-26 00:23:55 +00:00
mod routes;
use rocket_dyn_templates::Template;
#[rocket::launch]
fn rocket() -> _ {
2022-10-28 23:07:43 +00:00
let mut config = config::Config::new();
2022-10-28 22:41:49 +00:00
2022-10-26 00:23:55 +00:00
rocket::build()
2022-10-27 16:44:40 +00:00
.mount(
2022-10-28 22:41:49 +00:00
&config.path_prefix,
2022-10-27 16:44:40 +00:00
rocket::routes![routes::index, routes::submit, routes::success],
)
2022-10-28 22:41:49 +00:00
.manage(captcha_solutions::SharedCaptchaSolutions::new())
2022-10-28 23:07:43 +00:00
.manage(mailer::Mailer::new(&mut config).expect("Failed to create mailer!"))
2022-10-28 22:41:49 +00:00
.manage(config)
2022-10-26 00:23:55 +00:00
.attach(Template::fairing())
}