Browse Source

Deploying to heroku for test

unknown 4 năm trước cách đây
mục cha
commit
b4451e89b9
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      main.go

+ 2 - 2
main.go

@@ -26,7 +26,7 @@ func init() {
 var letterRunes = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
 
 func main() {
-
+	port := os.Getenv("PORT")
 	r := mux.NewRouter()
 
 	r.HandleFunc("/", PrinterList)
@@ -40,7 +40,7 @@ func main() {
 	fmt.Println("Server is listening...")
 
 	http.Handle("/", r)
-	http.ListenAndServe(":8888", nil)
+	http.ListenAndServe(":" + port, nil)
 }
 
 func generateCompatible(w http.ResponseWriter, r *http.Request){