1.2.4 • Published 2 years ago

request-seeker v1.2.4

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

request-seeker

A express middleware that will help you to log the details of the request that are sent to your express server and also log the response that is sent back to client.

HOW IT IS HELPFUL?

This middleware will help you to log the details of the request that are sent to the server and also the response that is sent to the client.

The log will contain details of: 1. ENDPOINT (aka route) 2. METHOD (request method) 3. BODY (payload that is sent in body of the request) 4. QUERY (parameter that sent in query string) 5. RESPONSE BODY (the response that is send by that particular route) -- optional

API Explanation

arg no.argdescrequired
1reqyes
2resyes
3nxtyes
4optionsused for customizing the logs

Options

attdescdefault
showResponseLogprint the response that is sent to every requestfalse
hideLogotoggle between showing or hiding the logofalse

HOW TO USE

    .. - normal code
    -> - code to add
  1. Import the middleware
  .. var app = express();
  -> var requestSeeker = require('request-seeker');
  1. use it
app.use((req, res, next) => {
    requestSeeker(req, res, next, { showResponseLog: true, hideLogo: true })
})
  .. app.get('/', (req, res) => {

References

  1. Logging request details
  2. Coloring log
  3. Logging response body
1.2.0

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

2.0.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago