chore: fix lambda build for netlify (#587)

This commit is contained in:
Bo-Yi Wu
2021-07-14 03:01:50 +08:00
committed by GitHub
parent ca7dcbd8dd
commit 45be946f54
4 changed files with 11 additions and 4 deletions

View File

@@ -4,6 +4,10 @@ package router
import (
"context"
"net/http"
"github.com/appleboy/gorush/config"
"github.com/appleboy/gorush/logx"
"github.com/apex/gateway"
)
@@ -11,11 +15,11 @@ import (
// RunHTTPServer provide run http or https protocol.
func RunHTTPServer(ctx context.Context, cfg config.ConfYaml, s ...*http.Server) (err error) {
if !cfg.Core.Enabled {
LogAccess.Debug("httpd server is disabled.")
logx.LogAccess.Debug("httpd server is disabled.")
return nil
}
LogAccess.Info("HTTPD server is running on " + cfg.Core.Port + " port.")
logx.LogAccess.Info("HTTPD server is running on " + cfg.Core.Port + " port.")
return gateway.ListenAndServe(cfg.Core.Address+":"+cfg.Core.Port, routerEngine())
return gateway.ListenAndServe(cfg.Core.Address+":"+cfg.Core.Port, routerEngine(cfg))
}