diff options
author | Baitinq <manuelpalenzuelamerino@gmail.com> | 2024-05-01 22:17:22 +0200 |
---|---|---|
committer | Baitinq <manuelpalenzuelamerino@gmail.com> | 2024-05-01 23:46:59 +0200 |
commit | a6f114d99e91990058f148d9fac7de0f72bbe0ff (patch) | |
tree | bf5cbd7b766312207b12f0a36359fa0de21ea740 | |
parent | k8s: rest-api: Set service externalTrafficPolicy to local (diff) | |
download | fs-tracer-backend-a6f114d99e91990058f148d9fac7de0f72bbe0ff.tar.gz fs-tracer-backend-a6f114d99e91990058f148d9fac7de0f72bbe0ff.tar.bz2 fs-tracer-backend-a6f114d99e91990058f148d9fac7de0f72bbe0ff.zip |
rest-api: Create specific payload endpoint
-rw-r--r-- | src/rest-api/cmd/main.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rest-api/cmd/main.go b/src/rest-api/cmd/main.go index c58d353..2fcd1ec 100644 --- a/src/rest-api/cmd/main.go +++ b/src/rest-api/cmd/main.go @@ -8,9 +8,13 @@ import ( ) func main() { - http.HandleFunc("/", handleRequest) + mux := http.NewServeMux() + mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + fmt.Fprint(w, "Hello folks!") + }) + mux.HandleFunc("/payload", handleRequest) - http.ListenAndServe(":8080", nil) + http.ListenAndServe(":8080", mux) } func handleRequest(w http.ResponseWriter, r *http.Request) { |