summaryrefslogtreecommitdiff
path: root/server/src/main.rs
blob: 34783acd0da8d125a4e4aa06f4fbcdb5ecc1e3f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
mod routes;
mod rooms;
mod room;

#[tokio::main]
async fn main() {
	let port = std::env::var("PORT")
		.unwrap_or("8080".to_owned())
		.parse::<u16>()
		.unwrap_or(8080);
	
	axum::Server::bind(&std::net::SocketAddr::new(
		std::net::IpAddr::V6(std::net::Ipv6Addr::from(0)),
		port
	))
		.serve(
			routes::routes()
				.into_make_service()
		)
		.await
		.expect("Error running the web server");
}