forked from Plume/Plume
Restore index page
This commit is contained in:
parent
4666cd3ee3
commit
e592e692ff
2 changed files with 13 additions and 12 deletions
13
src/main.rs
13
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,
|
||||
|
||||
|
|
|
@ -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::<String, i32>::new())
|
||||
|
|
Loading…
Reference in a new issue