Make it so the playground can decide which index file to serve. (#223)
* Make it so the playground can decide which index file to serve. Also remove special index-nw.html and use the current playground config to decide if to show the windows instances option or not. * Give a better name to the struct
This commit is contained in:
committed by
Marcos Nils
parent
2e039a4e60
commit
f277e3776c
@@ -1,6 +1,7 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
@@ -28,8 +29,8 @@ func Home(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if !playground.AllowWindowsInstances {
|
||||
http.ServeFile(w, r, "./www/index-nw.html")
|
||||
if playground.IndexFile != "" {
|
||||
http.ServeFile(w, r, fmt.Sprintf("./www/%s", playground.IndexFile))
|
||||
} else {
|
||||
http.ServeFile(w, r, "./www/index.html")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user