diff options
author | Anirudh Oppiliappan <x@icyphox.sh> | 2022-12-11 11:22:47 +0530 |
---|---|---|
committer | Anirudh Oppiliappan <x@icyphox.sh> | 2022-12-11 11:22:47 +0530 |
commit | 856f66808b913baff13c815daec3cdde7121e3bd (patch) | |
tree | 60feca35e702d20a0ec8da208b6b59926470bf31 /main.go | |
download | legit-856f66808b913baff13c815daec3cdde7121e3bd.tar.gz legit-856f66808b913baff13c815daec3cdde7121e3bd.tar.bz2 legit-856f66808b913baff13c815daec3cdde7121e3bd.zip |
all: init
Diffstat (limited to '')
-rw-r--r-- | main.go | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -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)) +} |