Added port to config file

This commit is contained in:
Jesper 2022-10-19 22:29:21 +02:00
parent 4c50448a9a
commit e92fbc20ef
2 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,5 @@
MYSQL_DB = "forkort"
MYSQL_USER = "forkort"
MYSQL_PASS = "Passw0rd"
MYSQL_HOST = "127.0.0.1:3306"
MYSQL_HOST = "127.0.0.1:3306"
PORT = ":8080"

View File

@ -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)
}