Restore index page
This commit is contained in:
parent
4666cd3ee3
commit
e592e692ff
13
src/main.rs
13
src/main.rs
@ -46,24 +46,13 @@ fn init_pool() -> PgPool {
|
|||||||
Pool::new(manager).expect("db pool")
|
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() {
|
fn main() {
|
||||||
rocket::ignite()
|
rocket::ignite()
|
||||||
.mount("/", routes![
|
.mount("/", routes![
|
||||||
routes::well_known::host_meta,
|
routes::well_known::host_meta,
|
||||||
routes::well_known::webfinger,
|
routes::well_known::webfinger,
|
||||||
|
|
||||||
|
routes::instance::index,
|
||||||
routes::instance::configure,
|
routes::instance::configure,
|
||||||
routes::instance::post_config,
|
routes::instance::post_config,
|
||||||
|
|
||||||
|
@ -6,6 +6,18 @@ use std::collections::HashMap;
|
|||||||
use db_conn::DbConn;
|
use db_conn::DbConn;
|
||||||
use models::instance::*;
|
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")]
|
#[get("/configure")]
|
||||||
fn configure() -> Template {
|
fn configure() -> Template {
|
||||||
Template::render("instance/configure", HashMap::<String, i32>::new())
|
Template::render("instance/configure", HashMap::<String, i32>::new())
|
||||||
|
Loading…
Reference in New Issue
Block a user