summary refs log tree commit diff stats
path: root/main.go
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2019-05-12 03:59:29 -0400
committerBen Morrison <ben@gbmor.dev>2019-05-12 03:59:29 -0400
commit06cffd89aeea4d34c987a1e7583af7525b8534e8 (patch)
treeabfdd9883033d538d5da83dadc6458e09a5feea2 /main.go
parentdb3ecebbc2d131f9bd6a8d47e39dcecf785183e5 (diff)
downloadgetwtxt-06cffd89aeea4d34c987a1e7583af7525b8534e8.tar.gz
config fleshed out; using viper+pflag
Diffstat (limited to 'main.go')
-rw-r--r--main.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/main.go b/main.go
index 453426a..92b8971 100644
--- a/main.go
+++ b/main.go
@@ -1,6 +1,7 @@
 package main
 
 import (
+	"fmt"
 	"log"
 	"net/http"
 	"time"
@@ -11,8 +12,6 @@ import (
 
 const getwtxt = "0.1"
 
-var closelog = make(chan bool)
-
 func main() {
 	log.Printf("getwtxt " + getwtxt + "\n")
 
@@ -28,9 +27,11 @@ func main() {
 	api.HandleFunc("/{format:(?:plain)}/tags", apiTagsBaseHandler)
 	api.HandleFunc("/{format:(?:plain)}/tags/{tags:[a-zA-Z0-9]+}", apiTagsHandler)
 
+	portnum := fmt.Sprintf(":%v", confObj.port)
+
 	server := &http.Server{
 		Handler:      handlers.CompressHandler(index),
-		Addr:         ":9001",
+		Addr:         portnum,
 		WriteTimeout: 15 * time.Second,
 		ReadTimeout:  15 * time.Second,
 	}