Add favicon (#288)

This commit is contained in:
ByteDream 2023-02-16 17:09:24 +01:00 committed by GitHub
parent ccffe4028a
commit a866977cb0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 17 additions and 0 deletions

View file

@ -6,6 +6,7 @@ import (
"encoding/json"
"fmt"
"net/http"
"os"
"sort"
"strings"
"time"
@ -32,6 +33,15 @@ func Health() echo.HandlerFunc {
}
}
func Favicon() echo.HandlerFunc {
return func(c echo.Context) error {
if favicon, ok := os.LookupEnv(util.FaviconFilePathEnvVar); ok {
return c.File(favicon)
}
return c.Redirect(http.StatusFound, util.BasePath+"/static/custom/img/favicon.ico")
}
}
// LoginPage handler
func LoginPage() echo.HandlerFunc {
return func(c echo.Context) error {