mylloon.fr/src/main.rs

20 lines
446 B
Rust
Raw Normal View History

2023-02-08 20:49:05 +01:00
use actix_web::{App, HttpServer};
mod config;
mod template;
#[path = "routes/index.rs"]
mod index;
#[actix_web::main]
async fn main() -> std::io::Result<()> {
let config = config::get_config("config/config.toml");
2023-02-08 20:58:24 +01:00
let addr = ("127.0.0.1", config.port);
2023-02-08 20:49:05 +01:00
println!("Listening to {}://{}:{}", config.scheme, addr.0, addr.1);
2023-02-08 20:58:24 +01:00
2023-02-08 20:49:05 +01:00
HttpServer::new(|| App::new().service(index::page))
.bind(addr)?
.run()
.await
2023-02-02 11:06:27 +01:00
}