feat(aws): support lambda (#334)
This commit is contained in:
19
gorush/server_lambda.go
Normal file
19
gorush/server_lambda.go
Normal file
@@ -0,0 +1,19 @@
|
||||
// +build lambda
|
||||
|
||||
package gorush
|
||||
|
||||
import (
|
||||
"github.com/apex/gateway"
|
||||
)
|
||||
|
||||
// RunHTTPServer provide run http or https protocol.
|
||||
func RunHTTPServer() error {
|
||||
if !PushConf.Core.Enabled {
|
||||
LogAccess.Debug("httpd server is disabled.")
|
||||
return nil
|
||||
}
|
||||
|
||||
LogAccess.Debug("HTTPD server is running on " + PushConf.Core.Port + " port.")
|
||||
|
||||
return gateway.ListenAndServe(PushConf.Core.Address+":"+PushConf.Core.Port, routerEngine())
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// +build !windows
|
||||
// +build !windows,!lambda
|
||||
|
||||
package gorush
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// +build windows
|
||||
// +build windows,!lambda
|
||||
|
||||
package gorush
|
||||
|
||||
|
||||
Reference in New Issue
Block a user