This commit is contained in:
11
main.go
11
main.go
@@ -247,6 +247,17 @@ func main() {
|
|||||||
|
|
||||||
mux := http.NewServeMux()
|
mux := http.NewServeMux()
|
||||||
mux.Handle("/ubuntu/", http.StripPrefix("/ubuntu", handler))
|
mux.Handle("/ubuntu/", http.StripPrefix("/ubuntu", handler))
|
||||||
|
// Microsoft-Repos unter /ms/ (nur wenn vorhanden)
|
||||||
|
if st, err := os.Stat(*msRoot); err == nil && st.IsDir() {
|
||||||
|
mux.Handle("/ms/", http.StripPrefix("/ms", fileHandler{
|
||||||
|
fs: http.Dir(*msRoot),
|
||||||
|
autoIndex: *autoIndex,
|
||||||
|
cacheMaxAge: time.Duration(*cacheSeconds) * time.Second,
|
||||||
|
}))
|
||||||
|
log.Printf("serving Microsoft repos at /ms from %s", *msRoot)
|
||||||
|
} else {
|
||||||
|
log.Printf("warn: microsoft root not found (%s) — /ms disabled", *msRoot)
|
||||||
|
}
|
||||||
mux.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) {
|
mux.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) {
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
_, _ = w.Write([]byte("ok"))
|
_, _ = w.Write([]byte("ok"))
|
||||||
|
|||||||
Reference in New Issue
Block a user