mirror of
https://github.com/ditatompel/xmr-remote-nodes.git
synced 2024-11-16 17:07:36 +00:00
feat: Added robots.txt route
This commit is contained in:
parent
5a22a0b71f
commit
c1c72274cf
2 changed files with 6 additions and 0 deletions
|
@ -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{
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue