Files
gitlab-ci/ci/app/main.go
2022-09-06 15:11:35 +07:00

25 lines
424 B
Go

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)
}