JRE Dependency Fix + Port Configuration

This commit is contained in:
Mark Adkins
2020-11-22 17:53:04 -05:00
parent 12a16c381b
commit 57665c4ec4
3 changed files with 14 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ package main
import (
"flag"
"os"
"github.com/gin-gonic/gin"
log "github.com/sirupsen/logrus"
@@ -85,8 +86,17 @@ func main() {
}
}
swaggerUrl := ginSwagger.URL("http://127.0.0.1:8080/swagger/doc.json")
swaggerPort := getEnv("PORT", "8080")
swaggerUrl := ginSwagger.URL("http://127.0.0.1:" + string(swaggerPort) + "/swagger/doc.json")
router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler, swaggerUrl))
router.Run()
}
func getEnv(key string, defaultVal string) string {
if value, exists := os.LookupEnv(key); exists {
return value
}
return defaultVal
}