-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.go
31 lines (29 loc) · 626 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Created By ybenel
// Date: 20/07/2019 || Updated in 2023/02/09
package main
import (
"fmt"
app "github.com/M1ndo/TokYo/pkg/app"
"os"
)
func main() {
cfg := app.DefaultConfig()
err := cfg.ReadFile("config.json")
if err != nil && !os.IsNotExist(err) {
panic(err)
}
app.ParseFlags(cfg)
a, err := app.NewApp(cfg)
logger := a.GetLogger()
if err != nil {
logger.Log.Fatal(err)
a.Debug.Logger.Debug(err)
}
addr := fmt.Sprintf("%s:%d", cfg.Server.Host, cfg.Server.Port)
logger.Log.Infof("Local server: http://%s", addr)
err = a.Run()
if err != nil {
logger.Log.Fatal(err)
a.Debug.Logger.Debug(err)
}
}