diff options
author | Baitinq <manuelpalenzuelamerino@gmail.com> | 2024-05-01 20:04:53 +0200 |
---|---|---|
committer | Baitinq <manuelpalenzuelamerino@gmail.com> | 2024-05-01 20:04:53 +0200 |
commit | 91710e28e6806f92f96211a775c24aa93b8ecd6a (patch) | |
tree | 0730ef330cce4deb1dd19f5616deb0f6d1bdf5c2 /src/rest-api/cmd/main.go | |
parent | Build images with bazel (diff) | |
download | fs-tracer-backend-91710e28e6806f92f96211a775c24aa93b8ecd6a.tar.gz fs-tracer-backend-91710e28e6806f92f96211a775c24aa93b8ecd6a.tar.bz2 fs-tracer-backend-91710e28e6806f92f96211a775c24aa93b8ecd6a.zip |
rest-api: return request body
Diffstat (limited to '')
-rw-r--r-- | src/rest-api/cmd/main.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/rest-api/cmd/main.go b/src/rest-api/cmd/main.go index bfeb752..af72f82 100644 --- a/src/rest-api/cmd/main.go +++ b/src/rest-api/cmd/main.go @@ -6,9 +6,11 @@ import ( ) func main() { - http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { - fmt.Fprint(w, "Hello, World!") - }) + http.HandleFunc("/", handleRequest) - http.ListenAndServe(":8080", nil) + http.ListenAndServe(":8080", nil) +} + +func handleRequest(w http.ResponseWriter, r *http.Request) { + fmt.Fprint(w, "Hello, World!", r.Body) } |