updated
هذا الالتزام موجود في:
21
test-projects/go-web-test/main.go
Normal file
21
test-projects/go-web-test/main.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
port := os.Getenv("PORT")
|
||||
if port == "" {
|
||||
port = "8000"
|
||||
}
|
||||
|
||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprintln(w, "Hello from Go!")
|
||||
})
|
||||
|
||||
fmt.Println("Server listening on :" + port)
|
||||
http.ListenAndServe(":"+port, nil)
|
||||
}
|
||||
المرجع في مشكلة جديدة
حظر مستخدم