You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
275 B
Rust

use rocket::{http::Status, State};
use crate::db::DB;
#[get("/")]
pub async fn site_index(db : &State<DB>) -> Result<String, (Status, String)> {
let site = db.get_site_data().await.unwrap();
let response = serde_json::to_string(&site).unwrap();
Ok(response)
}