diff options
author | Baitinq <manuelpalenzuelamerino@gmail.com> | 2024-05-30 19:23:04 +0200 |
---|---|---|
committer | Baitinq <manuelpalenzuelamerino@gmail.com> | 2024-05-30 19:24:17 +0200 |
commit | ff1f10801f8852f9ef9f0cecf4cd7ada3ad06c12 (patch) | |
tree | ee9aeddc71e17d86fa3ba2eb089c8e8aff535a6d | |
parent | misc: Check for DB_PASSWORD in deploy script (diff) | |
download | fs-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.go | 5 |
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) |