diff --git a/internal/handler/response.go b/internal/handler/response.go index be5de1a..94ad689 100644 --- a/internal/handler/response.go +++ b/internal/handler/response.go @@ -26,6 +26,11 @@ func (s *fiberServer) redirectLogs(c *fiber.Ctx) error { return c.Redirect(fmt.Sprintf("/remote-nodes/id/%d", id), fiber.StatusMovedPermanently) } +// Render robots.txt +func (s *fiberServer) robotsTxtHandler(c *fiber.Ctx) error { + return c.SendString("User-agent: *\nAllow: /\n") +} + // Render Home Page func (s *fiberServer) homeHandler(c *fiber.Ctx) error { p := views.Meta{ diff --git a/internal/handler/routes.go b/internal/handler/routes.go index 0030cd7..1d591fe 100644 --- a/internal/handler/routes.go +++ b/internal/handler/routes.go @@ -2,6 +2,7 @@ package handler func (s *fiberServer) Routes() { s.App.Get("/", s.homeHandler) + s.App.Get("/robots.txt", s.robotsTxtHandler) s.App.Get("/remote-nodes", s.remoteNodesHandler) s.App.Get("/remote-nodes/id/:id", s.nodeHandler) s.App.Get("/add-node", s.addNodeHandler)