dockerize

This commit is contained in:
thuanle
2024-07-14 00:14:25 +07:00
parent 1307a1ba29
commit cc8449c7b3
5 changed files with 51 additions and 3 deletions

View File

@@ -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,