mirror of
https://github.com/dnote/dnote
synced 2026-03-14 22:45:50 +01:00
Serve robots
This commit is contained in:
parent
adb2b0a940
commit
7b1700ba3f
1 changed files with 4 additions and 0 deletions
|
|
@ -111,6 +111,10 @@ func NewRouter(app *app.App, rc RouteConfig) (http.Handler, error) {
|
|||
staticHandler := http.StripPrefix("/static/", http.FileServer(http.Dir(app.Config.StaticDir)))
|
||||
router.PathPrefix("/static/").Handler(staticHandler)
|
||||
|
||||
router.HandleFunc("/robots.txt", func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Write([]byte("User-agent: *\nAllow: /"))
|
||||
})
|
||||
|
||||
// catch-all
|
||||
router.PathPrefix("/").HandlerFunc(rc.Controllers.Static.NotFound)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue