diff --git a/Cargo.toml b/Cargo.toml index 82053c4..ac37dbe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [features] -default = ["rowing-tera", "rest"] +default = ["rest", "rowing-tera" ] rowing-tera = ["rocket_dyn_templates", "tera"] rest = [] diff --git a/src/main.rs b/src/main.rs index afa64f2..d78387d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,13 +1,15 @@ use std::str::FromStr; +#[cfg(feature = "rest")] +use rot::rest; #[cfg(feature = "rowing-tera")] use rot::tera; + use sqlx::{pool::PoolOptions, sqlite::SqliteConnectOptions, ConnectOptions}; #[macro_use] extern crate rocket; -#[cfg(feature = "rowing-tera")] #[launch] async fn rocket() -> _ { use sqlx::SqlitePool; @@ -26,8 +28,8 @@ async fn rocket() -> _ { #[cfg(feature = "rowing-tera")] let rocket = tera::config(rocket); - //#[cfg(feature = "rest")] - //let rocket = rest::config(rocket); + #[cfg(feature = "rest")] + let rocket = rest::config(rocket); rocket } diff --git a/src/rest/mod.rs b/src/rest/mod.rs index aaf4bba..011b9f4 100644 --- a/src/rest/mod.rs +++ b/src/rest/mod.rs @@ -1,7 +1,7 @@ use rocket::{fs::FileServer, Build, Rocket}; pub fn config(rocket: Rocket) -> Rocket { - rocket.mount("/beta", FileServer::from("svelte/build")) + rocket.mount("/", FileServer::from("svelte/build").rank(0)) } //#[cfg(test)] diff --git a/svelte/svelte.config.js b/svelte/svelte.config.js index feabc04..5d59908 100644 --- a/svelte/svelte.config.js +++ b/svelte/svelte.config.js @@ -13,8 +13,8 @@ const config = { // See https://kit.svelte.dev/docs/adapters for more information about adapters. adapter: adapter({ fallback: 'app.html', - }) - } + }), + }, }; export default config;