Fault-tolerant delivery system
This commit is contained in:
@@ -42,7 +42,7 @@ impl Application {
|
||||
let listener = TcpListener::bind(address).await?;
|
||||
let connection_pool =
|
||||
PgPoolOptions::new().connect_lazy_with(configuration.database.with_db());
|
||||
let email_client = EmailClient::new(configuration.email_client);
|
||||
let email_client = EmailClient::build(configuration.email_client).unwrap();
|
||||
let pool = Pool::new(
|
||||
Config::from_url(configuration.redis_uri.expose_secret())
|
||||
.expect("Failed to parse Redis URL string"),
|
||||
@@ -88,7 +88,10 @@ pub fn app(
|
||||
let admin_routes = Router::new()
|
||||
.route("/dashboard", get(admin_dashboard))
|
||||
.route("/password", get(change_password_form).post(change_password))
|
||||
.route("/newsletters", get(publish_form).post(publish))
|
||||
.route(
|
||||
"/newsletters",
|
||||
get(publish_newsletter_form).post(publish_newsletter),
|
||||
)
|
||||
.route("/logout", post(logout))
|
||||
.layer(middleware::from_fn(require_auth));
|
||||
Router::new()
|
||||
|
||||
Reference in New Issue
Block a user