Skip to content

Commit b45182d

Browse files
easyCZroboquat
authored andcommitted
[public-api-server] Serve a hello world over http
1 parent c9bb2d8 commit b45182d

File tree

1 file changed

+8
-1
lines changed
  • components/public-api-server

1 file changed

+8
-1
lines changed

components/public-api-server/main.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,15 @@ package main
66

77
import (
88
"fmt"
9+
"net/http"
910
)
1011

1112
func main() {
12-
fmt.Println("Hello world!")
13+
addr := ":9000"
14+
err := http.ListenAndServe(addr, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
15+
_, _ = w.Write([]byte(`hello world`))
16+
}))
17+
if err != nil {
18+
fmt.Println("Failed to server on", addr, err)
19+
}
1320
}

0 commit comments

Comments
 (0)