-
Notifications
You must be signed in to change notification settings - Fork 0
/
evetax.go
47 lines (36 loc) · 931 Bytes
/
evetax.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package main
import (
"log"
"os"
"runtime"
"github.com/morpheusxaut/evetax/database"
"github.com/morpheusxaut/evetax/misc"
"github.com/morpheusxaut/evetax/web"
)
func main() {
runtime.GOMAXPROCS(runtime.NumCPU())
config, err := misc.LoadConfig()
if err != nil {
log.Fatalf("Failed to load config: [%v]", err)
os.Exit(2)
}
misc.SetupLogger(config.DebugLevel)
db, err := database.SetupDatabase(config)
if err != nil {
misc.Logger.Criticalf("Failed to set up database: [%v]", err)
os.Exit(2)
}
err = db.Connect()
if err != nil {
misc.Logger.Criticalf("Failed to connect to database: [%v]", err)
os.Exit(2)
}
templates := web.SetupTemplates()
checksums, err := web.SetupAssetChecksums()
if err != nil {
misc.Logger.Criticalf("Failed to calculate asset checkums: [%v]", err)
os.Exit(2)
}
controller := web.SetupController(config, db, templates, checksums)
controller.HandleRequests()
}