summaryrefslogtreecommitdiffstats
path: root/main.go
blob: 07d4b67037da5e1c9748e7660e370cc9474cd7ed (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package main

import (
	"flag"
	"log"
	"net/http"

	"icyphox.sh/legit/config"
	"icyphox.sh/legit/routes"
)

func main() {
	var cfg string
	flag.StringVar(&cfg, "config", "./config.yaml", "path to config file")
	flag.Parse()

	c, err := config.Read(cfg)
	if err != nil {
		log.Fatal(err)
	}

	mux := routes.Handlers(c)
	log.Fatal(http.ListenAndServe(":5555", mux))
}