Can now configure HostPort. Closes #4.

master
Zed A. Shaw 1 month ago
parent c03f8efb47
commit 9264925ae1
  1. 1
      .ozai.json
  2. 3
      config/settings.go
  3. 2
      main.go

@ -1,4 +1,5 @@
{
"HostPort": ":9998",
"Processes": {
"tester1": {
"URL": "/tester1",

@ -20,6 +20,7 @@ type Process struct {
type config struct {
Processes map[string]Process
ConfigPath string
HostPort string
}
var Settings config
@ -40,4 +41,6 @@ func Load() {
err = json.Unmarshal(data, &Settings)
if err != nil { log.Fatal(err) }
if Settings.HostPort == "" { Settings.HostPort = ":9999" }
}

@ -66,5 +66,5 @@ func main() {
})
}
log.Fatal(http.ListenAndServe(":9999", nil))
log.Fatal(http.ListenAndServe(config.Settings.HostPort, nil))
}

Loading…
Cancel
Save