diff --git a/src/main.rs b/src/main.rs index 8c331b5d..c31b5e9e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -46,24 +46,13 @@ fn init_pool() -> PgPool { Pool::new(manager).expect("db pool") } -#[get("/")] -fn index(conn: DbConn) -> String { - match Instance::get_local(&*conn) { - Some(inst) => { - format!("Welcome on {}", inst.name) - } - None => { - String::from("Not initialized") - } - } -} - fn main() { rocket::ignite() .mount("/", routes![ routes::well_known::host_meta, routes::well_known::webfinger, + routes::instance::index, routes::instance::configure, routes::instance::post_config, diff --git a/src/routes/instance.rs b/src/routes/instance.rs index cc7f4703..4a3b8863 100644 --- a/src/routes/instance.rs +++ b/src/routes/instance.rs @@ -6,6 +6,18 @@ use std::collections::HashMap; use db_conn::DbConn; use models::instance::*; +#[get("/")] +fn index(conn: DbConn) -> String { + match Instance::get_local(&*conn) { + Some(inst) => { + format!("Welcome on {}", inst.name) + } + None => { + String::from("Not initialized") + } + } +} + #[get("/configure")] fn configure() -> Template { Template::render("instance/configure", HashMap::::new())