-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
57 lines (45 loc) · 978 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
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
package main
import (
"embed"
"log"
"github.com/ystv/computing_site/link"
"github.com/ystv/computing_site/team"
)
//go:embed public/*
var embeddedFiles embed.FS
//go:embed cert.pem
var cert []byte
//go:embed key.pem
var key []byte
var (
Commit = "unknown"
Version = "unknown"
)
func main() {
if len(cert) == 0 || len(key) == 0 {
log.Fatalf("missing required cert or key")
}
link1, err := link.New()
if err != nil {
log.Printf("failed to get link: %+v\n", err)
}
team1, err := team.New()
if err != nil {
log.Printf("failed to get team: %+v\n", err)
}
addr := "0.0.0.0:7075"
router := NewRouter(&RouterConf{
Address: addr,
Link: link1,
Team: team1,
Commit: Commit,
Version: Version,
cert: cert,
key: key,
})
log.Printf("YSTV Computing site: %s, commit: %s, version: %s\n", addr, Commit, Version)
err = router.Start()
if err != nil {
log.Fatalf("The web server couldn't be started!\n\n%s\n\nExiting!", err)
}
}