Configuration
The api class has the following options:
Option
Type
Description
logger
(Optional)
object
Custom the configuration logger
The logger
option has the following options:
Option
Type
Description
trace
(Optional)
boolean
Enable trace to request, response and errors
pretty
(Optional)
boolean
Enable the pretty format to logger.
handler
(Optional)
Function
Method that returns the response of each logger
Example:
const api = new Api({
logger: {
trace: true,
pretty: false,
handler: (log) => {
// process or transform the log
}
}
});
Last updated
Was this helpful?