dockerize
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"github.com/rs/zerolog/log"
|
||||
"net/http"
|
||||
"os"
|
||||
"thuanle.me/ip-info/configs"
|
||||
"thuanle.me/ip-info/configs/key"
|
||||
)
|
||||
|
||||
@@ -25,6 +26,9 @@ func StartApiService() {
|
||||
engine.GET("/json", HandleJson)
|
||||
|
||||
port := os.Getenv(key.EnvApiPort)
|
||||
if len(port) == 0 {
|
||||
port = configs.ApiDefaultPort
|
||||
}
|
||||
srv = &http.Server{
|
||||
Addr: ":" + port,
|
||||
Handler: engine,
|
||||
|
||||
Reference in New Issue
Block a user