Implement --host flag to override {{.Host}}

Fixes #15
This commit is contained in:
Daan Sprenkels
2019-12-15 16:48:50 +05:30
parent 41f4de43ac
commit 0bffde1dc1
12 changed files with 98 additions and 66 deletions

View File

@@ -13,6 +13,7 @@ var (
fileStorePath = flag.String("file-store", "", "path to the directory where uploaded files will be stored")
httpListen = flag.String("listen", "127.0.0.1:8000", "listen address (host:port)")
metricsListen = flag.String("metrics_listen", "127.0.0.1:58614", "listen address for metrics (host:port)")
hostURL = flag.String("host", "", "host root (defaults to using the request 'Host' header with HTTPS")
)
func main() {
@@ -29,5 +30,5 @@ func main() {
defer database.Close()
go rushlink.StartMetricsServer(*metricsListen, database, filestore)
rushlink.StartMainServer(*httpListen, database, filestore)
rushlink.StartMainServer(*httpListen, database, filestore, hostURL)
}