Browse Source

Add a robots.txt because why not

Signed-off-by: Amelia Aronsohn <WagThatTail@Me.com>
master
Amelia A 7 months ago
parent
commit
9420c6d811
Signed by: Amelia Aronsohn <WagThatTail@Me.com> GPG Key ID: 70C320ABA95D38C1
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      src/main.rs

+ 6
- 0
src/main.rs View File

@@ -75,10 +75,16 @@ fn draw_card(state: State<SharedCardList>) -> Result<Template, Status> {
}
}

#[get("/")]
fn robots_txt() -> &'static str {
"User-agent: *\nDisallow: /"
}

fn rocket() -> rocket::Rocket {
rocket::ignite()
.mount("/", routes![draw_card])
.mount(CARD_URI, StaticFiles::from(CARD_DIRECTORY))
.mount("/robots.txt", routes![robots_txt])
.attach(Template::fairing())
}


Loading…
Cancel
Save