Add states
This commit is contained in:
parent
6d388ed61b
commit
e860ffa86d
1 changed files with 10 additions and 3 deletions
13
src/main.rs
13
src/main.rs
|
@ -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())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue