aboutsummaryrefslogtreecommitdiff
path: root/backend/src/main.rs
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2021-12-29 16:11:27 +0100
committerIlion Beyst <ilion.beyst@gmail.com>2021-12-29 16:11:27 +0100
commit1fb4a5151bd8cfe6de4d8c19e2066a9281a0b61a (patch)
tree4adc79684acdcd703e2319e3444af66489623ebd /backend/src/main.rs
parent52242b03f1af7f73e73592c2e5ee2bc54813a64d (diff)
downloadplanetwars.dev-1fb4a5151bd8cfe6de4d8c19e2066a9281a0b61a.tar.xz
planetwars.dev-1fb4a5151bd8cfe6de4d8c19e2066a9281a0b61a.zip
migrate to axum
Diffstat (limited to 'backend/src/main.rs')
-rw-r--r--backend/src/main.rs18
1 files changed, 13 insertions, 5 deletions
diff --git a/backend/src/main.rs b/backend/src/main.rs
index 3c0efa8..c75aaf6 100644
--- a/backend/src/main.rs
+++ b/backend/src/main.rs
@@ -1,8 +1,16 @@
-#[macro_use]
-extern crate rocket;
+use std::net::SocketAddr;
+
extern crate mozaic4_backend;
+extern crate tokio;
+
+#[tokio::main]
+async fn main() {
+ let app = mozaic4_backend::app().await;
+
+ let addr = SocketAddr::from(([127, 0, 0, 1], 9000));
-#[launch]
-fn launch() -> rocket::Rocket<rocket::Build> {
- mozaic4_backend::rocket()
+ axum::Server::bind(&addr)
+ .serve(app.into_make_service())
+ .await
+ .unwrap();
}