add l3
This commit is contained in:
24
ci/app/main.go
Normal file
24
ci/app/main.go
Normal 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)
|
||||
}
|
Reference in New Issue
Block a user