添加BS框架接口

This commit is contained in:
chenxinquan 2023-11-16 11:25:29 +08:00
parent be0c88b316
commit 3f7eb1110a
1 changed files with 15 additions and 1 deletions

View File

@ -3,6 +3,8 @@ package main
import (
"github.com/gin-gonic/gin"
BsUtils"main/genmai/BsUtils"
// "time"
"net/http"
)
func main() {
@ -10,7 +12,19 @@ func main() {
r := gin.Default()
BsUtils.Route(r)
// r.Use(func(c *gin.Context){
// c.Header("Connection","keep-alive")
// c.Header("Keep-Alive","900")
// c.Next()
// })
server := &http.Server{
Addr: ":8001",
Handler: r,
// ReadTimeout: 10 * time.Second,
// WriteTimeout: 10 * time.Second,
}
// 运行Gin应用
r.Run(":8001")
_=server.ListenAndServe()
}