GoBlog/robotstxt.go

15 lines
346 B
Go
Raw Normal View History

package main
import (
"fmt"
"net/http"
)
func serveRobotsTXT(w http.ResponseWriter, r *http.Request) {
2021-02-08 17:51:07 +00:00
_, _ = w.Write([]byte(fmt.Sprintf("User-agent: *\nSitemap: %v", appConfig.Server.PublicAddress+sitemapPath)))
}
2021-02-27 07:31:06 +00:00
func servePrivateRobotsTXT(w http.ResponseWriter, r *http.Request) {
_, _ = w.Write([]byte("User-agent: *\nDisallow: /"))
}