// do not delete this handy little supporting function let formatres = (res, output, statusCode) => { // kill the global database connection if (connection != undefined && typeof(connection)=='object' && typeof(connection.end())=='object' ){ connection.end(); } res.statusCode = statusCode; res.body = JSON.stringify(output); return res; }