mirror of
https://github.com/nxshock/gron.git
synced 2024-11-27 03:41:00 +05:00
Switch to Roboto font
This commit is contained in:
parent
c952ded006
commit
b5afaea039
@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
_ "embed"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
@ -11,12 +12,16 @@ import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
//go:embed font.ttf
|
||||
var font []byte
|
||||
|
||||
func httpServer(listenAddress string) {
|
||||
if listenAddress == "none" {
|
||||
return
|
||||
}
|
||||
|
||||
http.HandleFunc("/", handler)
|
||||
http.HandleFunc("/font.ttf", handleFont)
|
||||
http.HandleFunc("/reloadJobs", handleReloadJobs)
|
||||
http.HandleFunc("/shutdown", handleShutdown)
|
||||
http.HandleFunc("/start", handleForceStart)
|
||||
@ -102,3 +107,9 @@ func handleReloadJobs(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
http.Redirect(w, r, "/", http.StatusTemporaryRedirect)
|
||||
}
|
||||
|
||||
func handleFont(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Add("Content-Type", "font/ttf")
|
||||
w.Header().Add("Cache-Control", "public") // TODO
|
||||
w.Write(font)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user