refactoring: new structure and mailer

This commit is contained in:
Per Stark
2024-12-19 23:15:12 +01:00
parent e54533d005
commit 13608bc41e
25 changed files with 659 additions and 379 deletions

View File

@@ -19,17 +19,20 @@ use zettle_db::{
server::{
middleware_api_auth::api_auth,
routes::{
auth::{show_signup_form, signup_handler},
file::upload_handler,
index::index_handler,
ingress::ingress_handler,
query::query_handler,
queue_length::queue_length_handler,
search_result::search_result_handler,
api::{
file::upload_handler, ingress::ingress_handler, query::query_handler,
queue_length::queue_length_handler,
},
html::{
auth::{show_signup_form, signup_handler},
index::index_handler,
search_result::search_result_handler,
},
},
AppState,
},
storage::{db::SurrealDbClient, types::user::User},
utils::mailer::Mailer,
};
#[tokio::main(flavor = "multi_thread", worker_threads = 2)]
@@ -59,6 +62,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
Ok(env)
});
let mailer = Mailer::new();
let app_state = AppState {
rabbitmq_producer: Arc::new(RabbitMQProducer::new(&config).await?),
rabbitmq_consumer: Arc::new(RabbitMQConsumer::new(&config, false).await?),