mirror of
https://github.com/m1k1o/neko.git
synced 2025-08-03 00:39:56 +02:00
add healthcheck.
This commit is contained in:
parent
cd15e0b03e
commit
5a79212b32
3 changed files with 16 additions and 0 deletions
|
@ -13,6 +13,12 @@ func Logger(next http.Handler) http.Handler {
|
|||
fn := func(w http.ResponseWriter, r *http.Request) {
|
||||
req := map[string]interface{}{}
|
||||
|
||||
// exclude healthcheck from logs
|
||||
if r.RequestURI == "/api/health" {
|
||||
next.ServeHTTP(w, r)
|
||||
return
|
||||
}
|
||||
|
||||
if reqID := middleware.GetReqID(r.Context()); reqID != "" {
|
||||
req["id"] = reqID
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue