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

@@ -28,7 +28,7 @@ func recoveryMiddleware(next http.Handler) http.Handler {
})
}
func StartMainServer() {
func StartMainServer(addr string) {
// Initialize Gorilla router
router := mux.NewRouter()
router.Use(recoveryMiddleware)
@@ -42,7 +42,7 @@ func StartMainServer() {
srv := &http.Server{
Handler: router,
Addr: "127.0.0.1:8000",
Addr: addr,
WriteTimeout: 15 * time.Second,
ReadTimeout: 15 * time.Second,
}