json-server icon indicating copy to clipboard operation
json-server copied to clipboard

Add Morgan Middleware for HTTP Request Logging

Open AaronDennis07 opened this issue 10 months ago • 0 comments

Summary

Added Morgan middleware to log details for each incoming request.

Details

  • Integrated the morgan package to enable HTTP request logging.
  • Configured Morgan to use the 'tiny' format for concise logs.
  • Logs will include essential details such as:
    • HTTP method
    • URL
    • Status code
    • Response time

Purpose

This enhancement improves visibility into incoming HTTP requests, aiding in debugging and monitoring the application.

Testing

  • Verified locally by observing logs for various API endpoints in the console.
  • Checked with different request methods (GET, POST, etc.) to ensure logs are correctly generated.

AaronDennis07 avatar Dec 05 '24 16:12 AaronDennis07