npm i @easydigitalstudio/express-server
Function used to validate the env variable format (upper case)
export default {
port: getConfig('PORT')
}
Function used to throw an error if the specified field is not provided
function myFunction(param = mustProvide('param')) {
// Param provided
}
Function used to log info or errors
const message = 'Hi boy!';
logger.info(message);
const error = new Error();
error.message = 'You failed';
error.status = 500;
logger.error(error);
Function to return a mongo collection
const userCollection = mongoCollection('user');
userCollection.insertOne({
name: 'toto',
age: 29
});