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.
paopao-ce/internal/app/app.go

30 lines
570 B

package app
import (
"net/http"
"github.com/rocboss/paopao-ce/internal/conf"
"github.com/rocboss/paopao-ce/internal/servants"
)
type Service interface {
Start()
Stop()
Info() string
}
func NewWebService() Service {
e := newWebEngine()
servants.RegisterWebServants(e)
return &webService{
server: &http.Server{
Addr: conf.ServerSetting.HttpIp + ":" + conf.ServerSetting.HttpPort,
Handler: e,
ReadTimeout: conf.ServerSetting.ReadTimeout,
WriteTimeout: conf.ServerSetting.WriteTimeout,
MaxHeaderBytes: 1 << 20,
},
}
}