WIP: auto env generator

This commit is contained in:
Jesse Malotaux 2025-04-11 18:59:30 +02:00
parent 3cc0a2017d
commit 0a4e798e86
5 changed files with 99 additions and 8 deletions

View file

@ -10,11 +10,18 @@ import (
func main() {
app.MCRMLogInit()
if helper.EnvGet("MCRM__PORT") == "" {
app.MCRMLog("Error: MCRM__PORT is not set")
}
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
apiInit(w, r)
})
helper.OpenBrowser("http://localhost:" + helper.EnvGet("MCRM__PORT"))
app.MCRMLog(http.ListenAndServe(":"+helper.EnvGet("MCRM__PORT"), nil))
}
func apiInit(w http.ResponseWriter, r *http.Request) {