This commit is contained in:
2022-09-06 15:11:35 +07:00
parent a3ace3a444
commit 2d0c627dc9
4 changed files with 92 additions and 0 deletions

24
ci/app/main.go Normal file
View File

@@ -0,0 +1,24 @@
package main
import (
"net/http"
"os"
"fmt"
)
func indexHandler(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("<h1>Hello World!</h1>"))
}
func main() {
port := os.Getenv("PORT")
if port == "" {
port = "3000"
}
fmt.Print("\nim run in http://127.0.0.1:", port)
mux := http.NewServeMux()
mux.HandleFunc("/", indexHandler)
http.ListenAndServe(":"+port, mux)
}