From 856f66808b913baff13c815daec3cdde7121e3bd Mon Sep 17 00:00:00 2001 From: Anirudh Oppiliappan Date: Sun, 11 Dec 2022 11:22:47 +0530 Subject: all: init --- main.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 main.go (limited to 'main.go') diff --git a/main.go b/main.go new file mode 100644 index 0000000..07d4b67 --- /dev/null +++ b/main.go @@ -0,0 +1,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)) +} -- cgit