mirror of
https://github.com/schollz/cowyo.git
synced 2023-08-10 21:13:00 +03:00
Added robots.txt
Former-commit-id: 454a51ff34ef55c4779b612a889ebc4b71f5ccd1 [formerly 65cec85d51b24e8e6403818d6fc9ee92764b95db] [formerly 4a5ebc206874a56da1317f6355b031439c553153 [formerly b704768ded
]]
Former-commit-id: a63ecf1a3b88a4afe0c6f288e119de367782d4d5 [formerly 174874a7f16dbeac2f1974710c9aa6fea14a5431]
Former-commit-id: c10740c3fec7640ee3cfe0ebf945cf4548aef7d9
This commit is contained in:
parent
a38648d46e
commit
7012b2b1a6
@ -23,6 +23,8 @@ func editNote(c *gin.Context) {
|
|||||||
title := c.Param("title")
|
title := c.Param("title")
|
||||||
if title == "ws" {
|
if title == "ws" {
|
||||||
wshandler(c.Writer, c.Request)
|
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 {
|
} else if strings.ToLower(title) == "about" { //}&& strings.Contains(AllowedIPs, c.ClientIP()) != true {
|
||||||
c.Redirect(302, "/about/view")
|
c.Redirect(302, "/about/view")
|
||||||
} else {
|
} else {
|
||||||
|
4
utils.go
4
utils.go
@ -11,6 +11,7 @@ import (
|
|||||||
|
|
||||||
var animals []string
|
var animals []string
|
||||||
var adjectives []string
|
var adjectives []string
|
||||||
|
var robots_txt string
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
rand.Seed(time.Now().Unix())
|
rand.Seed(time.Now().Unix())
|
||||||
@ -35,6 +36,9 @@ Have fun.
|
|||||||
|
|
||||||
**Powered by Raspberry Pi and Go** ![Raspberry Pi](/static/img/raspberrypi.png) ![Go Mascot](/static/img/gomascot.png)`
|
**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 {
|
func randomAnimal() string {
|
||||||
|
Loading…
Reference in New Issue
Block a user