From a2e61c5aa1c5942f24da78578b2d820f9e5814ba Mon Sep 17 00:00:00 2001 From: Cara Salter Date: Tue, 14 Dec 2021 16:32:44 -0500 Subject: [PATCH] web: Allow customization of listen port Signed-off-by: Cara Salter --- README.md | 1 + main.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fec280c..b73e7e5 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ Create a `.env` file with the following keys: - `DISCORD_TOKEN` - the Discord bot token - `BASE_URL` - the base public-facing URL, used to construct redirects - `SUCCESS_URL` - the URL to redirect to on success +- `LISTEN_PORT` - the HTTP port to bind the web server to ## Setup 1. Create an Azure "App Registration" in [the Azure Portal](https://portal.azure.com). diff --git a/main.go b/main.go index 02a7d7b..2fffc3e 100644 --- a/main.go +++ b/main.go @@ -137,5 +137,5 @@ func main() { go bot.StartDiscordBot(verifyChan) logoru.Info("Starting client") - logoru.Critical(http.ListenAndServe(":3000", nil)) + logoru.Critical(http.ListenAndServe(fmt.Sprintf(":%s", os.Getenv("LISTEN_PORT")), nil)) } -- 2.34.2