summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/main.go b/main.go
new file mode 100644
index 0000000..6e443a7
--- /dev/null
+++ b/main.go
@@ -0,0 +1,25 @@
+package main
+
+import (
+ "os"
+ "fmt"
+ "sanine.net/git/phlox/config"
+)
+
+func main() {
+ conf := loadConfig("config.json")
+ fmt.Println(conf.ListenAddress)
+ fmt.Println(conf.AssetDirectory)
+ fmt.Println(len(conf.Users))
+ fmt.Println(len(conf.Endpoints))
+}
+
+
+func loadConfig(filename string) config.Config {
+ conf, err := config.Load(filename)
+ if err != nil {
+ fmt.Fprintf(os.Stderr, "failed to load configuration file: %v\n", err.Error())
+ os.Exit(1)
+ }
+ return conf
+}