Browse Source

Add a robots.txt because why not

Signed-off-by: Amelia Aronsohn <WagThatTail@Me.com>
master
Amelia A 3 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> {
75 75
     }
76 76
 }
77 77
 
78
+#[get("/")]
79
+fn robots_txt() -> &'static str {
80
+    "User-agent: *\nDisallow: /"
81
+}
82
+
78 83
 fn rocket() -> rocket::Rocket {
79 84
     rocket::ignite()
80 85
         .mount("/", routes![draw_card])
81 86
         .mount(CARD_URI, StaticFiles::from(CARD_DIRECTORY))
87
+        .mount("/robots.txt", routes![robots_txt])
82 88
         .attach(Template::fairing())
83 89
 }
84 90
 

Loading…
Cancel
Save