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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 4 deletions

1
go.mod
View File

@ -14,6 +14,7 @@ require (
github.com/gin-gonic/gin v1.7.2
github.com/go-redis/redis/v7 v7.4.0
github.com/golang/protobuf v1.5.1
github.com/google/flatbuffers v2.0.0+incompatible // indirect
github.com/mattn/go-isatty v0.0.12
github.com/mitchellh/mapstructure v1.4.1
github.com/msalihkarakasli/go-hms-push v0.0.0-20200616114002-91cd23dfeed4

3
go.sum
View File

@ -184,8 +184,9 @@ github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA=
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/flatbuffers v1.12.0 h1:/PtAHvnBY4Kqnx/xCQ3OIV9uYcSFGScBsWI3Oogeh6w=
github.com/google/flatbuffers v1.12.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
github.com/google/flatbuffers v2.0.0+incompatible h1:dicJ2oXwypfwUGnB2/TYWYEKiuk9eYQlQO/AnOHl5mI=
github.com/google/flatbuffers v2.0.0+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=

View File

@ -3,6 +3,7 @@
functions = "release/linux/lambda"
[build.environment]
GO_VERSION = "1.16"
GO_IMPORT_PATH = "github.com/appleboy/gorush"
GO111MODULE = "on"

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))
}