mirror of https://github.com/rocboss/paopao-ce
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
675 B
27 lines
675 B
2 years ago
|
package main
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"net/http"
|
||
|
|
||
|
"github.com/gin-gonic/gin"
|
||
|
"github.com/rocboss/paopao-api/global"
|
||
|
"github.com/rocboss/paopao-api/internal/routers"
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
gin.SetMode(global.ServerSetting.RunMode)
|
||
|
|
||
|
router := routers.NewRouter()
|
||
|
s := &http.Server{
|
||
|
Addr: global.ServerSetting.HttpIp + ":" + global.ServerSetting.HttpPort,
|
||
|
Handler: router,
|
||
|
ReadTimeout: global.ServerSetting.ReadTimeout,
|
||
|
WriteTimeout: global.ServerSetting.WriteTimeout,
|
||
|
MaxHeaderBytes: 1 << 20,
|
||
|
}
|
||
|
|
||
|
fmt.Printf("\x1b[36m%s\x1b[0m\n", "PaoPao service listen on http://"+global.ServerSetting.HttpIp+":"+global.ServerSetting.HttpPort)
|
||
|
s.ListenAndServe()
|
||
|
}
|