Skip to content

Commit a7ff7d0

Browse files
committed
initial version
1 parent b6fc524 commit a7ff7d0

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

.gitignore

Whitespace-only changes.

go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module github.com/setlog/debug-k8s
2+
3+
go 1.13

main.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
"log"
6+
"net/http"
7+
"os"
8+
)
9+
10+
func hello(w http.ResponseWriter, req *http.Request) {
11+
fmt.Fprintf(w, "Hostname: "+os.Getenv("HOSTNAME")+"\n")
12+
}
13+
14+
func main() {
15+
http.HandleFunc("/hello", hello)
16+
log.Println("I am going to start...")
17+
if err := http.ListenAndServe(":http", nil); err != nil {
18+
panic(err)
19+
}
20+
}

0 commit comments

Comments
 (0)