-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
47 lines (39 loc) · 1.06 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
package main
import (
"github.com/gofiber/fiber/v2"
"github.com/rs/zerolog"
"github.com/fpmi-hci-2023/project13b-auth/config"
_ "github.com/fpmi-hci-2023/project13b-auth/docs"
"github.com/fpmi-hci-2023/project13b-auth/internal/grpcServer"
"github.com/fpmi-hci-2023/project13b-auth/internal/server"
"github.com/fpmi-hci-2023/project13b-auth/pkg/logger"
)
var (
Version string
Commit string
)
// @title Auth Service API
// @version 1.0
// @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html
// @host localhost:8080/
// @BasePath api/v1/
// @schemes http
func main() {
log := logger.NewLogger(config.DefaultWriter,
zerolog.TraceLevel,
"auth-setup")
config.Init(log)
if !fiber.IsChild() {
log.Info("env and logger setup complete")
log.Infof("auth starting with version: %v, commit: %v, FiberPrefork: %v",
Version, Commit, config.GlobalConfig.FiberPrefork)
}
// Starting gRPC server only once
if !fiber.IsChild() {
go grpcServer.Run()
}
// Start Fiber server
httpSrv := server.NewApp()
httpSrv.Run()
}