summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--controller/app.go4
-rw-r--r--main.go6
2 files changed, 8 insertions, 2 deletions
diff --git a/controller/app.go b/controller/app.go
index 172a2a2..fa21306 100644
--- a/controller/app.go
+++ b/controller/app.go
@@ -28,6 +28,10 @@ func NewApp(configFilename string) *App {
}
}
+func (app App) Config() config.Configuration {
+ return app.config
+}
+
func (app App) requireAuth(res http.ResponseWriter, req *http.Request) bool {
username, password, ok := req.BasicAuth()
if ok && username == app.config.Authentication.Username && password == app.config.Authentication.Password {
diff --git a/main.go b/main.go
index eef401a..1a42f39 100644
--- a/main.go
+++ b/main.go
@@ -62,6 +62,8 @@ func main() {
})
app.StartScheduler()
- log.Println(fmt.Sprintf("serving on http://%s\n", "127.0.0.1:8080"))
- log.Panicln(http.ListenAndServe("127.0.0.1:8080", nil))
+
+ host := app.Config().Http.ListenAddress
+ log.Println(fmt.Sprintf("serving on http://%s\n", host))
+ log.Panicln(http.ListenAndServe(host, nil))
}