aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Hurst <ark@mansus.space>2023-01-26 22:29:26 +0100
committerJulian Hurst <ark@mansus.space>2023-01-26 22:29:26 +0100
commit6052dbe8951e108e3a8d4c7b4493b920e60500fc (patch)
tree6cf48f92d4ec564e3a6f3ad9be71f6f24c659351
parent1eb03ae3bf16f755d8ab4b2697a65b06a1d83a5e (diff)
downloaddocspace-6052dbe8951e108e3a8d4c7b4493b920e60500fc.tar.gz
Add robots.txt support
-rw-r--r--main.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/main.go b/main.go
index 9105e84..204803a 100644
--- a/main.go
+++ b/main.go
@@ -600,6 +600,9 @@ func main() {
http.HandleFunc("/upload", upload)
http.HandleFunc("/download", download)
http.HandleFunc("/imgs", imgs)
+ http.HandleFunc("/robots.txt", func(w http.ResponseWriter, r *http.Request) {
+ http.ServeFile(w, r, "./robots.txt")
+ })
http.HandleFunc("/admin", admin)
http.HandleFunc("/admin/users", adminUsers)
log.Printf("Serving http://localhost:%d\n", *p)