frontend: add robots.txt to disallow

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
This commit is contained in:
Ahmet Alp Balkan 2018-08-22 19:29:55 -07:00
parent 4683ee449c
commit 04c3876e94
No known key found for this signature in database
GPG key ID: 5C02521D7B216AD6

View file

@ -119,6 +119,7 @@ func main() {
r.HandleFunc("/logout", svc.logoutHandler).Methods(http.MethodGet)
r.HandleFunc("/cart/checkout", svc.placeOrderHandler).Methods(http.MethodPost)
r.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir("./static/"))))
r.HandleFunc("/robots.txt", func(w http.ResponseWriter, r *http.Request) { fmt.Fprint(w, "User-agent: *\nDisallow: /") })
var handler http.Handler = r
handler = &logHandler{log: log, next: handler} // add logging