diff --git a/Dockerfile b/Dockerfile index 793e12c..c856520 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ FROM alpine:3 RUN apk add --no-cache ca-certificates WORKDIR /app COPY --from=builder /out/ncore-stats . -COPY index.html style.css script.js ./ +COPY web ./web EXPOSE 3000 CMD ["./ncore-stats"] diff --git a/main.go b/main.go index 73dd72f..89f0add 100644 --- a/main.go +++ b/main.go @@ -90,9 +90,7 @@ func main() { router := http.NewServeMux() router.HandleFunc("/api/profiles", state.profilesHandler) router.HandleFunc("/api/history", state.historyHandler) - router.HandleFunc("/", serveStatic("index.html", "text/html")) - router.HandleFunc("/style.css", serveStatic("style.css", "text/css")) - router.HandleFunc("/script.js", serveStatic("script.js", "application/javascript")) + router.Handle("/", http.FileServer(http.Dir("web"))) server := &http.Server{ Addr: config.ServerPort, diff --git a/index.html b/web/index.html similarity index 100% rename from index.html rename to web/index.html diff --git a/script.js b/web/script.js similarity index 100% rename from script.js rename to web/script.js diff --git a/style.css b/web/style.css similarity index 100% rename from style.css rename to web/style.css