Flags for listen and metrics address; fix in newRedirectPasteSuccess.txt.tmpl

Fixes #9
This commit is contained in:
2019-11-09 21:43:51 +01:00
parent e26e37c97d
commit b738116f8a
5 changed files with 15 additions and 16 deletions

View File

@@ -13,11 +13,7 @@ import (
bolt "go.etcd.io/bbolt"
)
const (
METRICS_ADDR = "127.0.0.1:58614"
)
func StartMetricsServer() {
func StartMetricsServer(addr string) {
var (
_ = promauto.NewGaugeFunc(prometheus.GaugeOpts{
Namespace: "rushlink",
@@ -45,7 +41,7 @@ func StartMetricsServer() {
router.Handle("/metrics", promhttp.Handler()).Methods("GET")
srv := &http.Server{
Handler: router,
Addr: METRICS_ADDR,
Addr: addr,
WriteTimeout: 15 * time.Second,
ReadTimeout: 15 * time.Second,
}