2024-03-23 19:35:31 +00:00
|
|
|
|
2024-03-23 20:03:16 +00:00
|
|
|
mod routes;
|
2024-03-23 19:35:31 +00:00
|
|
|
mod templates;
|
|
|
|
|
2024-03-23 20:03:16 +00:00
|
|
|
use actix_web::{web, App, HttpServer};
|
2024-03-23 19:35:31 +00:00
|
|
|
|
2024-03-23 20:03:16 +00:00
|
|
|
pub(crate) async fn start_actix() -> anyhow::Result<()> {
|
2024-03-23 20:06:04 +00:00
|
|
|
log::info!("Serving an http server at http://0.0.0.0:8080");
|
2024-03-23 20:03:16 +00:00
|
|
|
HttpServer::new(|| {
|
|
|
|
App::new()
|
|
|
|
.route("/", web::get().to(routes::index))
|
|
|
|
})
|
2024-03-23 19:35:31 +00:00
|
|
|
|
2024-03-23 20:03:16 +00:00
|
|
|
.bind("0.0.0.0:8080")?
|
|
|
|
.run()
|
|
|
|
.await?;
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
}
|