aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorNathan Lasseter <Nathan Lasseter nathan@bytemark.co.uk>2015-09-26 13:12:37 +0100
committerNathan Lasseter <Nathan Lasseter nathan@bytemark.co.uk>2015-09-26 13:12:37 +0100
commit267c89fe42050d056b8c041ee66008e304c0bcf3 (patch)
treedb3d519226bc8c58e3bd47196c6ae1fc25e0ca84 /main.go
parente13c16a261b71b7e590dda6c9ef826385b7b5b02 (diff)
Config now read from file at startupHEADmaster
Diffstat (limited to 'main.go')
-rw-r--r--main.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/main.go b/main.go
index dd3935e..225d022 100644
--- a/main.go
+++ b/main.go
@@ -1,11 +1,21 @@
package main
import (
+ "fmt"
"log"
"net/http"
+ "os"
)
+var config Config
+
func main() {
+ var err error
+ config, err = LoadFile("config.json")
+ if err != nil {
+ fmt.Fprintln(os.Stderr, "Error loading config")
+ os.Exit(1)
+ }
router := NewRouter()
log.Fatal(http.ListenAndServe(config.Server.Listen+":"+config.Server.Port, router))
}