-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
49 lines (36 loc) · 988 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
package main
import (
"fmt"
"log"
"net/http"
"github.com/cjexp/base/utility/command/param"
"github.com/cjexp/base/utility/router"
"github.com/cjexp/front/errorPage"
"github.com/cjexp/front/fileServer"
"github.com/cjexp/front/flashBagExp"
"github.com/cjexp/front/homePage"
"github.com/cjexp/front/vueJsExp"
"github.com/cjtoolkit/ctx/v2"
)
var build = "Undefined"
func boot() (http.Handler, param.Param) {
context := ctx.NewBackgroundContext()
defer ctx.ClearContext(context)
_param := param.GetParam(context)
fmt.Printf("Build: %q", build)
fmt.Println()
errorPage.Boot(context)
fileServer.Boot(context)
flashBagExp.Boot(context)
vueJsExp.Boot(context)
homePage.Boot(context)
fmt.Println("Booted up successfully.")
fmt.Println("")
return router.GetRouter(context), _param
}
func main() {
handler, _param := boot()
param.CheckIfTestRun(_param)
fmt.Println("Now listening on", _param.Address)
log.Print(http.ListenAndServe(_param.Address, handler))
}