summaryrefslogtreecommitdiff
path: root/rust/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rust/src/main.rs')
-rw-r--r--rust/src/main.rs4
1 files changed, 2 insertions, 2 deletions
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()