Implement favicon and static file support
|
@ -131,13 +131,18 @@ func main() {
|
|||
if err != nil {
|
||||
logger.Fatalf("could not initialize index handler: %v", err)
|
||||
}
|
||||
callbackHandler := handlers.NewCallbackHandler(ctx)
|
||||
callbackHandler := handlers.NewCallbackHandler(ctx, logger)
|
||||
afterLogoutHandler := handlers.NewAfterLogoutHandler(logger)
|
||||
staticFiles := http.FileServer(http.Dir("static"))
|
||||
|
||||
router := http.NewServeMux()
|
||||
router.Handle("/", authMiddleware(indexHandler))
|
||||
router.Handle("/callback", callbackHandler)
|
||||
router.Handle("/after-logout", afterLogoutHandler)
|
||||
router.Handle("/health", commonHandlers.NewHealthHandler())
|
||||
router.Handle("/images/", staticFiles)
|
||||
router.Handle("/css/", staticFiles)
|
||||
router.Handle("/js/", staticFiles)
|
||||
|
||||
nextRequestId := func() string {
|
||||
return fmt.Sprintf("%d", time.Now().UnixNano())
|
||||
|
|
|
@ -105,6 +105,7 @@ func main() {
|
|||
logoutHandler := handlers.NewLogoutHandler(handlerContext, logger)
|
||||
logoutSuccessHandler := handlers.NewLogoutSuccessHandler()
|
||||
errorHandler := handlers.NewErrorHandler()
|
||||
staticFiles := http.FileServer(http.Dir("static"))
|
||||
|
||||
router := http.NewServeMux()
|
||||
router.Handle("/login", loginHandler)
|
||||
|
@ -113,6 +114,9 @@ func main() {
|
|||
router.Handle("/error", errorHandler)
|
||||
router.Handle("/logout-successful", logoutSuccessHandler)
|
||||
router.Handle("/health", commonHandlers.NewHealthHandler())
|
||||
router.Handle("/images/", staticFiles)
|
||||
router.Handle("/css/", staticFiles)
|
||||
router.Handle("/js/", staticFiles)
|
||||
|
||||
if err != nil {
|
||||
logger.Fatal(err)
|
||||
|
|
2
static/images/CAcert-favicon-src.svg
Normal file
After Width: | Height: | Size: 7.4 KiB |
2
static/images/CAcert-logo.svg
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
static/images/favicon-120.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
static/images/favicon-128.png
Normal file
After Width: | Height: | Size: 5 KiB |
BIN
static/images/favicon-152.png
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
static/images/favicon-167.png
Normal file
After Width: | Height: | Size: 6.5 KiB |
BIN
static/images/favicon-180.png
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
static/images/favicon-192.png
Normal file
After Width: | Height: | Size: 7.7 KiB |
BIN
static/images/favicon-196.png
Normal file
After Width: | Height: | Size: 7.8 KiB |
BIN
static/images/favicon-228.png
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
static/images/favicon-32.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
static/images/favicon-57.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
static/images/favicon-76.png
Normal file
After Width: | Height: | Size: 3 KiB |
BIN
static/images/favicon-96.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
|
@ -1,7 +1,25 @@
|
|||
{{ define "base" }}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head><title>{{ .Title }}</title></head>
|
||||
<head>
|
||||
<title>{{ .Title }}</title>
|
||||
<!-- generics -->
|
||||
<link rel="icon" href="/images/favicon-32.png" sizes="32x32">
|
||||
<link rel="icon" href="/images/favicon-57.png" sizes="57x57">
|
||||
<link rel="icon" href="/images/favicon-76.png" sizes="76x76">
|
||||
<link rel="icon" href="/images/favicon-96.png" sizes="96x96">
|
||||
<link rel="icon" href="/images/favicon-128.png" sizes="128x128">
|
||||
<link rel="icon" href="/images/favicon-192.png" sizes="192x192">
|
||||
<link rel="icon" href="/images/favicon-228.png" sizes="228x228">
|
||||
|
||||
<!-- Android -->
|
||||
<link rel="shortcut icon" sizes="196x196" href="/images/favicon-196.png">
|
||||
|
||||
<!-- iOS -->
|
||||
<link rel="apple-touch-icon" href="/images/favicon-120.png" sizes="120x120">
|
||||
<link rel="apple-touch-icon" href="/images/favicon-152.png" sizes="152x152">
|
||||
<link rel="apple-touch-icon" href="/images/favicon-180.png" sizes="180x180">
|
||||
</head>
|
||||
<body>
|
||||
{{ template "content" . }}
|
||||
</body>
|
||||
|
|
|
@ -1,7 +1,25 @@
|
|||
{{ define "base" }}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head><title>{{ .Title }}</title></head>
|
||||
<head>
|
||||
<title>{{ .Title }}</title>
|
||||
<!-- generics -->
|
||||
<link rel="icon" href="/images/favicon-32.png" sizes="32x32">
|
||||
<link rel="icon" href="/images/favicon-57.png" sizes="57x57">
|
||||
<link rel="icon" href="/images/favicon-76.png" sizes="76x76">
|
||||
<link rel="icon" href="/images/favicon-96.png" sizes="96x96">
|
||||
<link rel="icon" href="/images/favicon-128.png" sizes="128x128">
|
||||
<link rel="icon" href="/images/favicon-192.png" sizes="192x192">
|
||||
<link rel="icon" href="/images/favicon-228.png" sizes="228x228">
|
||||
|
||||
<!-- Android -->
|
||||
<link rel="shortcut icon" sizes="196x196" href="/images/favicon-196.png">
|
||||
|
||||
<!-- iOS -->
|
||||
<link rel="apple-touch-icon" href="/images/favicon-120.png" sizes="120x120">
|
||||
<link rel="apple-touch-icon" href="/images/favicon-152.png" sizes="152x152">
|
||||
<link rel="apple-touch-icon" href="/images/favicon-180.png" sizes="180x180">
|
||||
</head>
|
||||
<body>
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ template "content" . }}
|
||||
|
|