File size: 317 Bytes
6bc074c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | package api
import (
"aurora/internal/bootstrap"
"github.com/gin-gonic/gin"
"net/http"
)
var router *gin.Engine
func init() {
// 初始化 gin
app, err := bootstrap.Init()
if err != nil {
panic(err)
}
router = app.Router
}
func Listen(w http.ResponseWriter, r *http.Request) {
router.ServeHTTP(w, r)
}
|