about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2024-05-01 20:04:53 +0200
committerBaitinq <manuelpalenzuelamerino@gmail.com>2024-05-01 20:04:53 +0200
commit91710e28e6806f92f96211a775c24aa93b8ecd6a (patch)
tree0730ef330cce4deb1dd19f5616deb0f6d1bdf5c2 /src
parentBuild images with bazel (diff)
downloadfs-tracer-backend-91710e28e6806f92f96211a775c24aa93b8ecd6a.tar.gz
fs-tracer-backend-91710e28e6806f92f96211a775c24aa93b8ecd6a.tar.bz2
fs-tracer-backend-91710e28e6806f92f96211a775c24aa93b8ecd6a.zip
rest-api: return request body
Diffstat (limited to 'src')
-rw-r--r--src/rest-api/cmd/main.go10
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)
 }