1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use crate::api::rcos::landing_page_stats::LandingPageStatistics;
use crate::error::TelescopeError;
use crate::templates::page::Page;
use crate::templates::Template;
use actix_web::HttpRequest;
const TEMPLATE_PATH: &'static str = "index";
#[get("/")]
pub async fn index(req: HttpRequest) -> Result<Page, TelescopeError> {
let stats = LandingPageStatistics::get().await?;
let mut template = Template::new(TEMPLATE_PATH);
template["stats"] = json!(stats);
return template.in_page(&req, "RCOS").await;
}