From 0bff0a98ce694a433844c084b6544c741a542b87 Mon Sep 17 00:00:00 2001 From: Alec Scott Date: Tue, 15 Jun 2021 16:50:45 -0700 Subject: [PATCH] Update Smuggler Port Config --- config/config.go | 4 ++-- smuggler.go | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/config/config.go b/config/config.go index f00e331..83f2ce0 100644 --- a/config/config.go +++ b/config/config.go @@ -14,7 +14,7 @@ type Config struct { type general struct { Version string - Port int64 + Port string } type save struct { @@ -33,7 +33,7 @@ func init() { func defaultConfig() { Global.General.Version = "0.0.1" - Global.General.Port = 8080 + Global.General.Port = "4500" Global.Save.Path = "smuggled/" } diff --git a/smuggler.go b/smuggler.go index ebfb943..c662aa7 100644 --- a/smuggler.go +++ b/smuggler.go @@ -11,10 +11,15 @@ import ( ) func main() { + port, err := strconv.Atoi(config.Global.General.Port) + if err != nil { + log.Fatal(err) + } + http.HandleFunc("/upload", web.Upload) http.HandleFunc("/", web.NotFound) fmt.Println("Smuggler Server Started!") - err := http.ListenAndServe(":"+strconv.FormatInt(int64(config.Global.General.Port), 10), nil) + err = http.ListenAndServe(":"+strconv.FormatInt(int64(port), 10), nil) if err != nil { log.Fatal(err) }