mirror of
https://github.com/Tilo-K/ddragon-cdn.git
synced 2026-01-09 16:41: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")))
|
fs := http.FileServer(http.Dir(filepath.Join(storageDir, "data")))
|
||||||
http.Handle("/", cors(fs))
|
http.Handle("/", cors(fs))
|
||||||
|
port := os.Getenv("Port")
|
||||||
|
|
||||||
log.Print("Listening on :60002...")
|
if port == ""{
|
||||||
err := http.ListenAndServe(":60002", nil)
|
port = "60002"
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Print("Listening on :" + port + "...")
|
||||||
|
err := http.ListenAndServe(":" + port, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user