rowt/src/rest/mod.rs

31 lines
856 B
Rust
Raw Normal View History

2023-07-16 19:16:42 +02:00
use rocket::{fs::FileServer, Build, Rocket};
2023-07-16 18:42:59 +02:00
pub fn config(rocket: Rocket<Build>) -> Rocket<Build> {
2023-07-16 20:07:38 +02:00
rocket.mount("/", FileServer::from("svelte/build").rank(0))
2023-07-16 18:42:59 +02:00
}
//#[cfg(test)]
//mod test {
// use crate::testdb;
//
// use super::start;
// use rocket::http::Status;
// use rocket::local::asynchronous::Client;
// use rocket::uri;
// use sqlx::SqlitePool;
//
// #[sqlx::test]
// fn test_not_logged_in() {
// let pool = testdb!();
//
// let client = Client::tracked(start(pool))
// .await
// .expect("valid rocket instance");
// let response = client.get(uri!(super::index)).dispatch().await;
//
// assert_eq!(response.status(), Status::SeeOther);
// let location = response.headers().get("Location").next().unwrap();
// assert_eq!(location, "/auth");
// }
//}