Methods
close() → {Promise.<undefined, Error>}
Closes the connection from mongoose to the database.
- Source:
Returns:
- Type:
-
Promise.<undefined, Error>
- Resolves when connection is closed.
open() → {Promise.<undefined, Error>}
Opens a connection from mongoose to the database.
- Source:
Returns:
- Type:
-
Promise.<undefined, Error>
- Resolves when connection is opened.
verify(request, response, next)
Middleware to determine whether the request is authenticated. For valid requests, the next middleware is called.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
request |
Object
|
The request object. |
response |
Object
|
The response object. |
next |
function
|
Invoke the next middleware or route. |
Type Definitions
customColors()
Logging tool for the server.
- Source:
Example
const logger = require('utils/logger.js');
logger.fatal('Message');
logger.error('Message');
logger.warn('Message');
logger.info('Message');
logger.debug('Message');
logger.trace('Message');