This repository was archived by the owner on Sep 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.go
More file actions
51 lines (44 loc) · 1.23 KB
/
Copy pathmain.go
File metadata and controls
51 lines (44 loc) · 1.23 KB
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
package main
import (
"os"
"github.com/Etwodev/Doctorate/server"
"github.com/Etwodev/Doctorate/server/router"
"github.com/Etwodev/Doctorate/server/router/account"
"github.com/Etwodev/Doctorate/server/router/announce"
"github.com/Etwodev/Doctorate/server/router/app"
"github.com/Etwodev/Doctorate/server/router/assetbundle"
"github.com/Etwodev/Doctorate/server/router/config"
"github.com/Etwodev/Doctorate/server/router/user"
"github.com/joho/godotenv"
"github.com/rs/zerolog/log"
)
func main() {
err := godotenv.Load()
if err != nil {
log.Fatal().Msg("Error loading .env file")
}
connection := os.Getenv("HOST_ROUTER_DSM")
name := os.Getenv("HOST_ROUTER_NAME")
address := os.Getenv("HOST_ROUTER_ADDRESS")
version := os.Getenv("HOST_ROUTER_VERSION")
port := os.Getenv("HOST_ROUTER_PORT")
experimental := (os.Getenv("HOST_ROUTER_EXPERIMENTAL") == "true")
s := server.Server{
Version: version,
Port: port,
Experimental: experimental,
Name: name,
Address: address,
Connection: connection,
}
s.Initilise()
routers := []router.Router{
config.NewRouter(true),
assetbundle.NewRouter(true),
account.NewRouter(true),
app.NewRouter(true),
user.NewRouter(true),
announce.NewRouter(true),
}
s.Start(routers...)
}