Skip to content
This repository was archived by the owner on Jun 24, 2024. It is now read-only.

Commit 8a13a7c

Browse files
author
Alexandre Dubois
committed
Add favicon
1 parent 4ed8781 commit 8a13a7c

4 files changed

Lines changed: 7 additions & 0 deletions

File tree

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ FROM alpine:latest AS production
1313
WORKDIR /app
1414
COPY --from=builder /app/plugins /app/plugins
1515
COPY --from=builder /app/index.html /app/index.html
16+
COPY --from=builder /app/favicon.ico /app/favicon.ico
1617
COPY --from=builder /app/dasher /app/dasher
1718

1819
CMD ["/app/dasher"]

Dockerfile_arm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ FROM arm32v7/alpine:latest AS production
1212
WORKDIR /app
1313
COPY --from=builder /app/plugins /app/plugins
1414
COPY --from=builder /app/index.html /app/index.html
15+
COPY --from=builder /app/favicon.ico /app/favicon.ico
1516
COPY --from=builder /app/dasher /app/dasher
1617

1718
CMD ["/app/dasher"]

favicon.ico

5.55 KB
Binary file not shown.

src/dasher.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ func home(w http.ResponseWriter, r *http.Request) {
2121
renderPage(w, config.Dashboards[0], 0)
2222
}
2323

24+
func favicon(w http.ResponseWriter, r *http.Request) {
25+
http.ServeFile(w, r, "favicon.ico")
26+
}
27+
2428
func next(w http.ResponseWriter, r *http.Request) {
2529
readConfigFile()
2630
initPlugins()
@@ -82,6 +86,7 @@ func main() {
8286

8387
http.HandleFunc("/", home)
8488
http.HandleFunc("/next", next)
89+
http.HandleFunc("/favicon.ico", favicon)
8590
err := http.ListenAndServe(":"+strconv.Itoa(config.Port), nil)
8691

8792
if err != nil {

0 commit comments

Comments
 (0)