From db58cb58b5d5612ec2aa347d0f8531b26ab2e7f3 Mon Sep 17 00:00:00 2001 From: niliara-edu Date: Fri, 27 Sep 2024 14:04:23 +0200 Subject: upload changes --- rust/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rust/src/main.rs') diff --git a/rust/src/main.rs b/rust/src/main.rs index 2ccdcee..af45779 100644 --- a/rust/src/main.rs +++ b/rust/src/main.rs @@ -1,4 +1,5 @@ mod structs; +mod routes; use actix_web::{web, App, HttpServer}; use sqlx::mysql::{MySqlPool, MySqlPoolOptions}; @@ -10,8 +11,6 @@ struct AppState { #[actix_web::main] async fn main() -> std::io::Result<()> { - const DB_URL: &str = "mysql://root:@127.0.0.1:3306/balalaika"; - let pool: MySqlPool = MySqlPoolOptions::new() .max_connections(10) .connect(DB_URL) @@ -24,6 +23,7 @@ async fn main() -> std::io::Result<()> { App::new() .app_data(web::Data::new(app_state.clone())) .route("/", web::get().to(root)) + .service(routes::hello::hello_actix) }) .bind(("127.0.0.1", 8000))? .run() -- cgit v1.2.3