feat(goswagger): Continue on goswagger template
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
65add2a61d
commit
9683e21ed4
@ -51,6 +51,7 @@ type Config struct {
|
||||
{{ pascalize .Name }}API
|
||||
{{ end -}}
|
||||
Logger func(string, ...interface{})
|
||||
|
||||
// InnerMiddleware is for the handler executors. These do not apply to the swagger.json document.
|
||||
// The middleware executes after routing but before authentication, binding and validation
|
||||
InnerMiddleware func(http.Handler) http.Handler
|
||||
|
@ -33,6 +33,12 @@ func main() {
|
||||
logrus.WithError(err).Fatal("fail to initialize gocommon.log")
|
||||
}
|
||||
|
||||
// Initialize listenAddress
|
||||
listenAddress, err := server.GetListenAddressFromEnvOrFlags()
|
||||
if err != nil {
|
||||
logger.WithError(err).Fatal("fail to initalize listenAddress")
|
||||
}
|
||||
|
||||
// Initialize tracing
|
||||
logger.Info("Initializing tracing")
|
||||
tp, err := tracing.Init()
|
||||
@ -62,7 +68,7 @@ func main() {
|
||||
}
|
||||
|
||||
srv := http.Server{
|
||||
Addr: ":8081",
|
||||
Addr: listenAddress,
|
||||
Handler: h,
|
||||
IdleTimeout: 30 * time.Second,
|
||||
ReadHeaderTimeout: 2 * time.Second,
|
||||
|
Loading…
Reference in New Issue
Block a user