Skip to content

Commit

Permalink
Added robots.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
schollz committed Feb 8, 2016
1 parent 5048dff commit b704768
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ func editNote(c *gin.Context) {
title := c.Param("title")
if title == "ws" {
wshandler(c.Writer, c.Request)
} else if title == "robots.txt" {
c.Data(200, "text/plain", []byte(robots_txt))
} else if strings.ToLower(title) == "about" { //}&& strings.Contains(AllowedIPs, c.ClientIP()) != true {
c.Redirect(302, "/about/view")
} else {
Expand Down
4 changes: 4 additions & 0 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

var animals []string
var adjectives []string
var robots_txt string

func init() {
rand.Seed(time.Now().Unix())
Expand All @@ -35,6 +36,9 @@ Have fun.
**Powered by Raspberry Pi and Go** ![Raspberry Pi](/static/img/raspberrypi.png) ![Go Mascot](/static/img/gomascot.png)`

robots_txt = `User-agent: *
Disallow: /`

}

func randomAnimal() string {
Expand Down

0 comments on commit b704768

Please sign in to comment.