contact-form/src/main.rs

23 lines
552 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 22:41:49 +00:00
let config = config::Config::new();
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())
.manage(mailer::Mailer::new(&config).expect("Failed to create mailer!"))
.manage(config)
2022-10-26 00:23:55 +00:00
.attach(Template::fairing())
}