From 6798c2f42f3dc68017a86e0bec364edf84687304 Mon Sep 17 00:00:00 2001 From: video-prize-ranch Date: Fri, 21 Jan 2022 18:35:12 -0500 Subject: [PATCH] Add robots.txt --- main.go | 6 ++++++ static/robots.txt | 2 ++ 2 files changed, 8 insertions(+) create mode 100644 static/robots.txt diff --git a/main.go b/main.go index 7938d0a..08a9f84 100644 --- a/main.go +++ b/main.go @@ -43,6 +43,12 @@ func main() { Root: http.FS(static.GetFiles()), })) + app.Get("/robots.txt", func(c *fiber.Ctx) error { + file, _ := static.GetFiles().ReadFile("robots.txt") + _, err := c.Write(file) + return err + }) + app.Get("/", pages.FrontpageHandler) app.Get("/:baseName.:extension", pages.HandleMedia) app.Get("/a/:galleryID", pages.HandleGallery) diff --git a/static/robots.txt b/static/robots.txt new file mode 100644 index 0000000..77470cb --- /dev/null +++ b/static/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: / \ No newline at end of file