refactor(app port): changed to have the port be dyncamic on the iis side

docker will default to 8080 and can be adjusted via the docker compose, or passing the same env over
it will change it as well.
This commit is contained in:
2025-07-23 07:36:18 -05:00
parent 13e282e815
commit 074032f20d
3 changed files with 38 additions and 2 deletions

View File

@@ -25,6 +25,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/joho/godotenv"
"lst.net/cmd/services/logging"
"lst.net/cmd/services/system/config"
_ "lst.net/docs"
"lst.net/utils/db"
)
@@ -110,10 +111,16 @@ func main() {
})
logging.RegisterLoggerRoutes(r, basePath)
config.RegisterConfigRoutes(r, basePath)
r.Any(basePath+"/api", errorApiLoc)
r.Run(":8080")
// get the server port
port := "8080"
if os.Getenv("VITE_SERVER_PORT") != "" {
port = os.Getenv("VITE_SERVER_PORT")
}
r.Run(":" + port)
}
// func serveViteApp(c *gin.Context) {