mylloon.fr/src/routes/networks.rs

19 lines
478 B
Rust
Raw Normal View History

2023-04-09 19:02:06 +02:00
use actix_web::{get, web, HttpResponse, Responder};
use ramhorns::Content;
2023-02-09 10:59:06 +01:00
2023-04-11 10:03:22 +02:00
use crate::{config::Config, template::Infos};
2023-02-09 11:19:53 +01:00
2023-02-09 10:59:06 +01:00
#[get("/networks")]
2023-04-09 19:02:06 +02:00
pub async fn page(config: web::Data<Config>) -> impl Responder {
HttpResponse::Ok().body(get_page(config.get_ref().clone()))
2023-02-09 10:59:06 +01:00
}
2023-04-09 19:02:06 +02:00
#[derive(Content)]
2023-02-09 10:59:06 +01:00
struct NetworksTemplate {}
2023-04-09 19:02:06 +02:00
pub fn get_page(config: Config) -> std::string::String {
2023-04-11 10:03:22 +02:00
config
.tmpl
.render("networks.html", NetworksTemplate {}, Infos::default())
2023-02-09 10:59:06 +01:00
}