From e1793b571eadb06c3da09697d379eccd72b12b73 Mon Sep 17 00:00:00 2001 From: mrw1593 Date: Wed, 15 Mar 2023 19:05:21 -0400 Subject: Created a basic HttpServer --- src/main.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index e7a11a9..ec04d93 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,14 @@ -fn main() { - println!("Hello, world!"); +use std::time::Duration; + +use actix_web::{App, HttpServer}; + +mod api; + +#[actix_web::main] +async fn main() -> std::io::Result<()> { + HttpServer::new(|| App::new().service(api::liveops())) + .shutdown_timeout(1) + .bind(("127.0.0.1", 8080))? + .run() + .await } -- cgit v1.2.3