mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-01-11 17:18:09 +02:00
Merge pull request #770 from msteinert/robots-txt
Serve `robots.txt` from `/`
This commit is contained in:
commit
55967e1f32
@ -1 +1 @@
|
|||||||
User-agent: *
|
User-agent: *
|
||||||
|
@ -137,6 +137,7 @@ func main() {
|
|||||||
// create handler for static resources
|
// create handler for static resources
|
||||||
assets := rice.MustFindBox("app").HTTPBox()
|
assets := rice.MustFindBox("app").HTTPBox()
|
||||||
assetserve := http.FileServer(rice.MustFindBox("app").HTTPBox())
|
assetserve := http.FileServer(rice.MustFindBox("app").HTTPBox())
|
||||||
|
http.Handle("/robots.txt", assetserve)
|
||||||
http.Handle("/static/", http.StripPrefix("/static", assetserve))
|
http.Handle("/static/", http.StripPrefix("/static", assetserve))
|
||||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Write(assets.MustBytes("index.html"))
|
w.Write(assets.MustBytes("index.html"))
|
||||||
|
Loading…
Reference in New Issue
Block a user