diff options
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -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 +} |