Skip to content

Commit

Permalink
log the incoming request
Browse files Browse the repository at this point in the history
  • Loading branch information
Divkix committed Jul 31, 2023
1 parent 98e8c53 commit 3ce77ca
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ func indexHandler(w http.ResponseWriter, req bunrouter.Request) error {
// Set the content type to JSON
w.Header().Set("Content-Type", "application/json")

// log the request
log.Printf("Received request from %s for %s\n", req.RemoteAddr, req.URL.Path)

// Return a JSON response with the status and uptime, truncated to seconds
return bunrouter.JSON(w,
bunrouter.H{
Expand Down

0 comments on commit 3ce77ca

Please sign in to comment.