We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 744c574 commit 0b3cefeCopy full SHA for 0b3cefe
1 file changed
serve/main.go
@@ -6,6 +6,7 @@ import (
6
"net/http"
7
"os"
8
"strconv"
9
+ "strings"
10
11
"github.com/julienschmidt/httprouter"
12
)
@@ -46,6 +47,9 @@ func main() {
46
47
func mux(static string, score ScoreHandler) *httprouter.Router {
48
r := httprouter.New()
49
if static != "" {
50
+ if !strings.HasSuffix(static, "/") {
51
+ static += "/"
52
+ }
53
r.GET("/", func(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
54
http.ServeFile(w, r, static+"index.html")
55
})
0 commit comments