Martin Berg Alstad 4fe388aca3 Config file with Port number.
Started implementing typespec for OpenAPI spec.
2024-06-07 14:37:47 +02:00

27 lines
550 B
Rust

use std::net::SocketAddr;
use tokio::net::{TcpListener, ToSocketAddrs};
use crate::routing::{simplify, table};
mod expressions;
mod parsing;
mod routing;
mod language;
mod config;
#[tokio::main]
async fn main() {
let addr = SocketAddr::from(([127, 0, 0, 1], config::PORT));
let listener = TcpListener::bind(&addr)
.await
.unwrap();
println!("Listening on: {}", listener.local_addr().unwrap());
let routes = simplify::router()
.merge(table::router());
axum::serve(listener, routes).await.unwrap();
}