refactor: agent and entities

This commit is contained in:
Henry Dollman
2024-08-14 14:14:41 -04:00
parent 083da9598e
commit c7e67a9b63
8 changed files with 168 additions and 171 deletions

View File

@@ -29,20 +29,14 @@ func main() {
log.Fatal("KEY environment variable is not set")
}
var port string
port := ":45876"
if p, exists := os.LookupEnv("PORT"); exists {
// allow passing an address in the form of "127.0.0.1:45876"
if !strings.Contains(port, ":") {
port = ":" + port
if !strings.Contains(p, ":") {
p = ":" + p
}
port = p
} else {
port = ":45876"
}
a := agent.NewAgent(pubKey, port)
a.Run()
agent.NewAgent(pubKey, port).Run()
}