-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathmain.go
More file actions
35 lines (32 loc) · 759 Bytes
/
main.go
File metadata and controls
35 lines (32 loc) · 759 Bytes
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
package main
import (
"fmt"
"free-gpt3.5-2api/FreeGpt35Pool"
"free-gpt3.5-2api/ProxyPool"
"free-gpt3.5-2api/config"
"free-gpt3.5-2api/router"
"github.com/aurorax-neo/go-logger"
"github.com/gin-gonic/gin"
)
func Init() {
ProxyPool.GetProxyPoolInstance()
FreeGpt35Pool.GetFreeGpt35PoolInstance()
}
func main() {
// Init
Init()
// Initialize HTTP server
gin.SetMode(gin.ReleaseMode)
server := gin.New()
server.Use(gin.Recovery())
// 设置路由
router.SetRouter(server)
// 提示服务启动
host := config.Bind
if config.Bind == "0.0.0.0" {
host = "127.0.0.1"
}
logger.Logger.Info(fmt.Sprint("Server started on http://", host, ":", config.Port))
// 启动 HTTP 服务器
_ = server.Run(fmt.Sprint(config.Bind, ":", config.Port))
}