2023-05-24 12:38:18 +00:00
|
|
|
use actix_web::{web, App, HttpServer};
|
|
|
|
use geneit_backend::app_config::AppConfig;
|
|
|
|
use geneit_backend::controllers::config_controller;
|
|
|
|
|
|
|
|
#[actix_web::main]
|
|
|
|
async fn main() -> std::io::Result<()> {
|
|
|
|
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));
|
|
|
|
|
|
|
|
log::info!("Start to listen on {}", AppConfig::get().listen_address);
|
|
|
|
|
|
|
|
HttpServer::new(|| {
|
|
|
|
App::new()
|
|
|
|
// Config controller
|
|
|
|
.route("/", web::get().to(config_controller::home))
|
|
|
|
.route(
|
|
|
|
"/config/static",
|
|
|
|
web::get().to(config_controller::static_config),
|
|
|
|
)
|
|
|
|
})
|
|
|
|
.bind(AppConfig::get().listen_address.as_str())?
|
|
|
|
.run()
|
|
|
|
.await
|
2023-05-24 09:37:02 +00:00
|
|
|
}
|