Start to build backend base

This commit is contained in:
2025-10-31 18:29:31 +01:00
parent f7e1d1539f
commit 602edaae79
8 changed files with 3373 additions and 6 deletions

View File

@@ -1,3 +1,27 @@
fn main() {
println!("Hello, world!");
use actix_session::storage::RedisSessionStore;
use actix_web::cookie::Key;
use actix_web::{App, HttpServer};
use matrixgw_backend::app_config::AppConfig;
#[tokio::main]
async fn main() -> std::io::Result<()> {
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));
let secret_key = Key::from(AppConfig::get().secret().as_bytes());
let redis_store = RedisSessionStore::new(AppConfig::get().redis_connection_string())
.await
.expect("Failed to connect to Redis!");
log::info!(
"Starting to listen on {} for {}",
AppConfig::get().listen_address,
AppConfig::get().website_origin
);
HttpServer::new(move || App::new())
.workers(4)
.bind(&AppConfig::get().listen_address)?
.run()
.await
}