mirror of https://gitee.com/openkylin/genmai.git
添加BS框架接口
This commit is contained in:
parent
be0c88b316
commit
3f7eb1110a
|
@ -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()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue