aboutsummaryrefslogtreecommitdiff
path: root/main.go
blob: 225d022c706a1a50e7af4db90896d9de378da43b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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))
}