Files
oliverch 874d27158d feat: add /robots.txt (#1355)
* feat: add /robots.txt

* disallow all crawler by default.
2019-09-16 16:21:08 -05:00

15 lines
285 B
Go

package actions
import (
"net/http"
"github.com/gomods/athens/pkg/config"
)
// robotsHandler implements GET baseURL/robots.txt
func robotsHandler(c *config.Config) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, c.RobotsFile)
}
}