-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
45 lines (37 loc) · 779 Bytes
/
main.go
File metadata and controls
45 lines (37 loc) · 779 Bytes
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package main
import (
"flag"
"log"
"os"
"strings"
"github.com/uzushikaminecraft/api/auth"
"github.com/uzushikaminecraft/api/config"
"github.com/uzushikaminecraft/api/db"
"github.com/uzushikaminecraft/api/dev"
_ "github.com/uzushikaminecraft/api/docs"
"github.com/uzushikaminecraft/api/handlers"
)
func main() {
// Flag definitions
confPath := ""
flag.StringVar(&confPath, "config", "./config.toml", "path to config.toml")
flag.Parse()
// Init config
err := config.Init(confPath)
if err != nil {
log.Fatalln(err)
}
// Init db
err = db.Init()
if err != nil {
log.Fatalln(err)
}
// Init Discord OAuth
auth.Init()
// For development
if strings.Contains(os.Args[0], "go-build") {
dev.Init()
}
// Init / run the web server
handlers.Setup()
}