mirror of
https://github.com/skidoodle/ncore-stats.git
synced 2026-04-28 15:57:37 +02:00
Refactor web assets structure; migrate HTML, CSS, and JS to new directory and update Dockerfile for new paths
This commit is contained in:
+1
-1
@@ -10,7 +10,7 @@ FROM alpine:3
|
|||||||
RUN apk add --no-cache ca-certificates
|
RUN apk add --no-cache ca-certificates
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=builder /out/ncore-stats .
|
COPY --from=builder /out/ncore-stats .
|
||||||
COPY index.html style.css script.js ./
|
COPY web ./web
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
CMD ["./ncore-stats"]
|
CMD ["./ncore-stats"]
|
||||||
|
|||||||
@@ -90,9 +90,7 @@ func main() {
|
|||||||
router := http.NewServeMux()
|
router := http.NewServeMux()
|
||||||
router.HandleFunc("/api/profiles", state.profilesHandler)
|
router.HandleFunc("/api/profiles", state.profilesHandler)
|
||||||
router.HandleFunc("/api/history", state.historyHandler)
|
router.HandleFunc("/api/history", state.historyHandler)
|
||||||
router.HandleFunc("/", serveStatic("index.html", "text/html"))
|
router.Handle("/", http.FileServer(http.Dir("web")))
|
||||||
router.HandleFunc("/style.css", serveStatic("style.css", "text/css"))
|
|
||||||
router.HandleFunc("/script.js", serveStatic("script.js", "application/javascript"))
|
|
||||||
|
|
||||||
server := &http.Server{
|
server := &http.Server{
|
||||||
Addr: config.ServerPort,
|
Addr: config.ServerPort,
|
||||||
|
|||||||
Reference in New Issue
Block a user