-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
executable file
·77 lines (56 loc) · 1.4 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package main
import (
"os"
"path"
"github.com/louisevanderlith/cars/controllers"
"github.com/louisevanderlith/cars/routers"
"github.com/louisevanderlith/droxolite"
"github.com/louisevanderlith/droxolite/bodies"
"github.com/louisevanderlith/droxolite/do"
"github.com/louisevanderlith/droxolite/element"
"github.com/louisevanderlith/droxolite/resins"
"github.com/louisevanderlith/droxolite/servicetype"
)
func main() {
keyPath := os.Getenv("KEYPATH")
pubName := os.Getenv("PUBLICKEY")
host := os.Getenv("HOST")
profile := os.Getenv("PROFILE")
pubPath := path.Join(keyPath, pubName)
conf, err := droxolite.LoadConfig()
if err != nil {
panic(err)
}
// Register with router
srv := bodies.NewService(conf.Appname, pubPath, conf.HTTPPort, servicetype.APP)
routr, err := do.GetServiceURL("", "Router.API", false)
if err != nil {
panic(err)
}
err = srv.Register(routr)
if err != nil {
panic(err)
}
err = droxolite.UpdateTheme(srv.ID)
if err != nil {
panic(err)
}
theme, err := element.GetDefaultTheme(host, srv.ID, profile)
if err != nil {
panic(err)
}
secur, err := do.GetServiceURL(srv.ID, "Auth.APP", true)
if err != nil {
panic(err)
}
err = theme.LoadTemplate("./views", "master.html")
if err != nil {
panic(err)
}
poxy := resins.NewColourEpoxy(srv, theme, secur, controllers.Index)
routers.Setup(poxy)
err = droxolite.Boot(poxy)
if err != nil {
panic(err)
}
}