File size: 464 Bytes
435c11e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
package api

import (
	"github.com/gin-gonic/gin"
	"groqai2api/initialize"
	"net/http"
)

var router *gin.Engine

func init() {
	// 初始化配置
	initialize.InitConfig()
	// 初始化缓存
	initialize.InitCache()
	// 初始化代理
	initialize.InitProxy()
	// 初始化账号
	initialize.InitAuth()
	// 初始化gin
	router = initialize.InitRouter()
}

func Listen(w http.ResponseWriter, r *http.Request) {
	router.ServeHTTP(w, r)
}