mirror of
https://github.com/Tilo-K/ddragon-cdn.git
synced 2026-01-09 00:21:01 +00:00
Added dynamic port
This commit is contained in:
9
main.go
9
main.go
@@ -252,9 +252,14 @@ func main() {
|
||||
|
||||
fs := http.FileServer(http.Dir(filepath.Join(storageDir, "data")))
|
||||
http.Handle("/", cors(fs))
|
||||
port := os.Getenv("Port")
|
||||
|
||||
log.Print("Listening on :60002...")
|
||||
err := http.ListenAndServe(":60002", nil)
|
||||
if port == ""{
|
||||
port = "60002"
|
||||
}
|
||||
|
||||
log.Print("Listening on :" + port + "...")
|
||||
err := http.ListenAndServe(":" + port, nil)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user