-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.go
39 lines (32 loc) · 940 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
// Code generated by hertz generator.
package main
import (
"math/rand"
"time"
"github.com/xhdd123321/whicinth-steganography-bd/biz/pkg/tinify"
"github.com/cloudwego/hertz/pkg/app/server"
"github.com/xhdd123321/whicinth-steganography-bd/biz/pkg/cronjob"
"github.com/xhdd123321/whicinth-steganography-bd/biz/pkg/godotenv"
"github.com/xhdd123321/whicinth-steganography-bd/biz/pkg/qiniu"
"github.com/xhdd123321/whicinth-steganography-bd/biz/pkg/redis"
"github.com/xhdd123321/whicinth-steganography-bd/biz/pkg/viper"
)
func main() {
rand.Seed(time.Now().UnixNano())
godotenv.InitGodotenv()
viper.InitViper()
redis.InitRedis()
qiniu.InitQiniu()
cronjob.InitCronjob()
tinify.InitTinify()
serverInit()
}
func serverInit() {
h := server.Default(
server.WithHostPorts(viper.Conf.App.HostPorts),
server.WithMaxRequestBodySize(viper.Conf.App.MaxRequestBodySize),
server.WithExitWaitTime(60),
)
register(h)
h.Spin()
}