respect config port
This commit is contained in:
parent
04f7f97b62
commit
bace6e7fa4
9
main.go
9
main.go
|
@ -7,7 +7,6 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"arimelody-web/admin"
|
"arimelody-web/admin"
|
||||||
|
@ -67,12 +66,8 @@ func main() {
|
||||||
|
|
||||||
// start the web server!
|
// start the web server!
|
||||||
mux := createServeMux()
|
mux := createServeMux()
|
||||||
port, err := strconv.ParseInt(os.Getenv("ARIMELODY_PORT"), 10, 0)
|
fmt.Printf("Now serving at http://127.0.0.1:%d\n", global.Config.Port)
|
||||||
if err != nil {
|
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", global.Config.Port), global.HTTPLog(mux)))
|
||||||
port = DEFAULT_PORT
|
|
||||||
}
|
|
||||||
fmt.Printf("Now serving at http://127.0.0.1:%d\n", port)
|
|
||||||
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", port), global.HTTPLog(mux)))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func createServeMux() *http.ServeMux {
|
func createServeMux() *http.ServeMux {
|
||||||
|
|
Loading…
Reference in a new issue