aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
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))
}