diff --git a/config.toml.example b/config.toml.example index c0ba5a9..eb74be9 100644 --- a/config.toml.example +++ b/config.toml.example @@ -1,4 +1,5 @@ MYSQL_DB = "forkort" MYSQL_USER = "forkort" MYSQL_PASS = "Passw0rd" -MYSQL_HOST = "127.0.0.1:3306" \ No newline at end of file +MYSQL_HOST = "127.0.0.1:3306" +PORT = ":8080" \ No newline at end of file diff --git a/main.go b/main.go index 1775bda..893de19 100644 --- a/main.go +++ b/main.go @@ -194,6 +194,7 @@ type Config struct { MYSQL_USER string MYSQL_PASS string MYSQL_HOST string + PORT string } func main() { @@ -227,5 +228,5 @@ func main() { router.HandleFunc(`/{token}`, UnshortenHandler) router.PathPrefix("/static/").Handler(http.StripPrefix("/static", http.FileServer(http.Dir("./assets")))) - http.ListenAndServe(":8080", router) + http.ListenAndServe(cfg.PORT, router) }