From 7b1700ba3fe36bb5c283743979738ee433fc48e8 Mon Sep 17 00:00:00 2001 From: Sung Won Cho Date: Mon, 18 Apr 2022 14:30:05 +1000 Subject: [PATCH] Serve robots --- pkg/server/controllers/routes.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/server/controllers/routes.go b/pkg/server/controllers/routes.go index 585d3d2b..90b095e0 100644 --- a/pkg/server/controllers/routes.go +++ b/pkg/server/controllers/routes.go @@ -111,6 +111,10 @@ func NewRouter(app *app.App, rc RouteConfig) (http.Handler, error) { staticHandler := http.StripPrefix("/static/", http.FileServer(http.Dir(app.Config.StaticDir))) router.PathPrefix("/static/").Handler(staticHandler) + router.HandleFunc("/robots.txt", func(w http.ResponseWriter, r *http.Request) { + w.Write([]byte("User-agent: *\nAllow: /")) + }) + // catch-all router.PathPrefix("/").HandlerFunc(rc.Controllers.Static.NotFound)