mirror of
https://github.com/cgzirim/seek-tune.git
synced 2025-12-17 08:54:19 +00:00
convert SERVE_HTTPS value to boolean
This commit is contained in:
parent
8ab15dc8d9
commit
d88e27ddf0
1 changed files with 5 additions and 1 deletions
6
main.go
6
main.go
|
|
@ -9,6 +9,7 @@ import (
|
|||
"net/http"
|
||||
"song-recognition/spotify"
|
||||
"song-recognition/utils"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/mdobak/go-xerrors"
|
||||
|
|
@ -77,7 +78,10 @@ func main() {
|
|||
defer server.Close()
|
||||
|
||||
SERVE_HTTPS := strings.ToLower(utils.GetEnv("SERVE_HTTPS", "true"))
|
||||
serveHTTPS := SERVE_HTTPS == "false"
|
||||
serveHTTPS, err := strconv.ParseBool(SERVE_HTTPS)
|
||||
if err != nil {
|
||||
log.Fatalf("Error converting string to bool: %v", err)
|
||||
}
|
||||
|
||||
serveHTTP(server, serveHTTPS)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue