From 5fd272f207d8231889fe6483f299679cd7951327 Mon Sep 17 00:00:00 2001 From: Martin Thielecke Date: Sat, 9 May 2020 03:38:08 +0200 Subject: [PATCH] make web server port configurable --- README.md | 2 +- main.go | 2 +- settings.go | 1 + settings.yml.dist | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3534721..4dac650 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Move settings.yml.dist to settings.yml and set the Params Create app in Twitch Dev Console https://dev.twitch.tv/console/apps -Set http://localhost:8083/callback as OAuth Redirect URL +Set http://localhost:8080/callback as OAuth Redirect URL (change the port to your setting in the settings.yml) Copy Client-ID and Secret to settings.yml diff --git a/main.go b/main.go index 7c2f504..2ae5229 100644 --- a/main.go +++ b/main.go @@ -39,7 +39,7 @@ func main() { }() log.Info("Starting webserver...") - log.Fatal(http.ListenAndServe(":8083", mux)) + log.Fatal(http.ListenAndServe(":"+settings.WebserverPort, mux)) } func handleSaves() { diff --git a/settings.go b/settings.go index 9f8011c..2232cda 100644 --- a/settings.go +++ b/settings.go @@ -20,6 +20,7 @@ type Settings struct { ClientID string `yaml:"client_id"` ClientSecret string `yaml:"client_secret"` VerificationToken string `yaml:"verification_token"` + WebserverPort string `yaml:"webserver_port"` } func loadSettings() { diff --git a/settings.yml.dist b/settings.yml.dist index 40325f6..d95861d 100644 --- a/settings.yml.dist +++ b/settings.yml.dist @@ -1,3 +1,4 @@ client_id: "your twitch client id" client_secret: "your twitch client secret" verification_token: "a random string!" +webserver_port: 8080