From 1962522f396aa4d6c4f37fd80d889ca56485128c Mon Sep 17 00:00:00 2001 From: manerakai Date: Sat, 2 Sep 2023 12:43:19 +0000 Subject: [PATCH] Added address config git-svn-id: file:///srv/svn/repo/mai/trunk@24 e410bdd4-646f-c54f-a7ce-fffcc4f439ae --- web/main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/main.go b/web/main.go index aa0d1b9..c5e737a 100644 --- a/web/main.go +++ b/web/main.go @@ -4,6 +4,7 @@ import ( "bytes" "net/http" "net/url" + "os" "time" "codeberg.org/SimpleWeb/SimplyTranslate/engines" @@ -215,5 +216,9 @@ func main() { app.Static("/static", "./static") - app.Listen(":3000") + address := os.Getenv("ADDRESS") + if address == "" { + address = "127.0.0.1:3000" + } + app.Listen(address) }