mirror of
https://github.com/prometheus/prometheus
synced 2025-04-17 04:38:10 +00:00
parent
757ab938db
commit
1d794896ac
@ -31,6 +31,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
listenAddress = flag.String("listenAddress", ":9090", "Address to listen on for web interface.")
|
listenAddress = flag.String("listenAddress", ":9090", "Address to listen on for web interface.")
|
||||||
useLocalAssets = flag.Bool("useLocalAssets", false, "Read assets/templates from file instead of binary.")
|
useLocalAssets = flag.Bool("useLocalAssets", false, "Read assets/templates from file instead of binary.")
|
||||||
|
userAssetsPath = flag.String("userAssets", "", "Path to static asset directory, available at /user")
|
||||||
)
|
)
|
||||||
|
|
||||||
type WebService struct {
|
type WebService struct {
|
||||||
@ -65,6 +66,10 @@ func (w WebService) ServeForever() error {
|
|||||||
exp.Handle("/static/", http.StripPrefix("/static/", new(blob.Handler)))
|
exp.Handle("/static/", http.StripPrefix("/static/", new(blob.Handler)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if *userAssetsPath != "" {
|
||||||
|
exp.Handle("/user/", http.StripPrefix("/user/", http.FileServer(http.Dir(*userAssetsPath))))
|
||||||
|
}
|
||||||
|
|
||||||
log.Printf("listening on %s", *listenAddress)
|
log.Printf("listening on %s", *listenAddress)
|
||||||
|
|
||||||
return http.ListenAndServe(*listenAddress, exp.DefaultCoarseMux)
|
return http.ListenAndServe(*listenAddress, exp.DefaultCoarseMux)
|
||||||
|
Loading…
Reference in New Issue
Block a user