chore: fix lambda build for netlify (#587)
This commit is contained in:
parent
ca7dcbd8dd
commit
45be946f54
1
go.mod
1
go.mod
|
@ -14,6 +14,7 @@ require (
|
||||||
github.com/gin-gonic/gin v1.7.2
|
github.com/gin-gonic/gin v1.7.2
|
||||||
github.com/go-redis/redis/v7 v7.4.0
|
github.com/go-redis/redis/v7 v7.4.0
|
||||||
github.com/golang/protobuf v1.5.1
|
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/mattn/go-isatty v0.0.12
|
||||||
github.com/mitchellh/mapstructure v1.4.1
|
github.com/mitchellh/mapstructure v1.4.1
|
||||||
github.com/msalihkarakasli/go-hms-push v0.0.0-20200616114002-91cd23dfeed4
|
github.com/msalihkarakasli/go-hms-push v0.0.0-20200616114002-91cd23dfeed4
|
||||||
|
|
3
go.sum
3
go.sum
|
@ -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/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 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/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 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.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.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
functions = "release/linux/lambda"
|
functions = "release/linux/lambda"
|
||||||
|
|
||||||
[build.environment]
|
[build.environment]
|
||||||
|
GO_VERSION = "1.16"
|
||||||
GO_IMPORT_PATH = "github.com/appleboy/gorush"
|
GO_IMPORT_PATH = "github.com/appleboy/gorush"
|
||||||
GO111MODULE = "on"
|
GO111MODULE = "on"
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,10 @@ package router
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/appleboy/gorush/config"
|
||||||
|
"github.com/appleboy/gorush/logx"
|
||||||
|
|
||||||
"github.com/apex/gateway"
|
"github.com/apex/gateway"
|
||||||
)
|
)
|
||||||
|
@ -11,11 +15,11 @@ import (
|
||||||
// RunHTTPServer provide run http or https protocol.
|
// RunHTTPServer provide run http or https protocol.
|
||||||
func RunHTTPServer(ctx context.Context, cfg config.ConfYaml, s ...*http.Server) (err error) {
|
func RunHTTPServer(ctx context.Context, cfg config.ConfYaml, s ...*http.Server) (err error) {
|
||||||
if !cfg.Core.Enabled {
|
if !cfg.Core.Enabled {
|
||||||
LogAccess.Debug("httpd server is disabled.")
|
logx.LogAccess.Debug("httpd server is disabled.")
|
||||||
return nil
|
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))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue