about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2024-05-30 19:23:04 +0200
committerBaitinq <manuelpalenzuelamerino@gmail.com>2024-05-30 19:24:17 +0200
commitff1f10801f8852f9ef9f0cecf4cd7ada3ad06c12 (patch)
treeee9aeddc71e17d86fa3ba2eb089c8e8aff535a6d
parentmisc: Check for DB_PASSWORD in deploy script (diff)
downloadfs-tracer-backend-ff1f10801f8852f9ef9f0cecf4cd7ada3ad06c12.tar.gz
fs-tracer-backend-ff1f10801f8852f9ef9f0cecf4cd7ada3ad06c12.tar.bz2
fs-tracer-backend-ff1f10801f8852f9ef9f0cecf4cd7ada3ad06c12.zip
rest-api: return 404 for all other routes except /
-rw-r--r--src/rest-api/cmd/main.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/rest-api/cmd/main.go b/src/rest-api/cmd/main.go
index ff91856..a493913 100644
--- a/src/rest-api/cmd/main.go
+++ b/src/rest-api/cmd/main.go
@@ -61,6 +61,11 @@ func main() {
 
 	mux := http.NewServeMux()
 	mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
+		if r.URL.Path != "/" {
+			http.NotFound(w, r)
+			return
+		}
+
 		fmt.Fprint(w, "Hello folks!")
 	})
 	mux.Handle("/api/v1/file/", handler)