diff --git a/backend/src/main.rs b/backend/src/main.rs index 0f8c2d8..c136517 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -1,10 +1,11 @@ mod api; -use rocket::fs::FileServer; +use std::path::{Path, PathBuf}; + +use rocket::fs::{FileServer, NamedFile, Options}; use rocket_cors::CorsOptions; use rocket_db_pools::{mongodb, Database}; use rocket_okapi::{ - openapi, rapidoc::*, settings::{OpenApiSettings, UrlObject}, swagger_ui::{make_swagger_ui, SwaggerUIConfig}, @@ -17,12 +18,6 @@ extern crate rocket; #[database("party")] pub struct Db(mongodb::Client); -#[openapi] -#[get("/")] -fn index() -> String { - format!("Hello, world!") -} - #[launch] fn rocket() -> _ { let cors = CorsOptions::default() @@ -33,7 +28,9 @@ fn rocket() -> _ { let building_rocket = rocket::build() .attach(Db::init()) .attach(cors) - .mount("/", FileServer::from("./web/dist")) + .mount("/", FileServer::from("./web/dist").rank(5)) + .mount("/users", FileServer::from("./web/dist")) + .mount("/events", FileServer::from("./web/dist")) .mount( "/swagger", make_swagger_ui(&SwaggerUIConfig { diff --git a/web/dist/index.html b/web/dist/index.html index 01963f2..fd21a3f 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -1,12 +1,12 @@
- + + + -