Error: handler method did not return a value, a promise, or throw an error
{
method: 'GET',
path: '/departments',
handler: (request, h) => {
// let results=[];
connection.query('SELECT * FROM departments', function (Error, results) {
if (Error) {
console.log(Error);
return Error;
}
console.log(JSON.stringify(results));
});
return h.response(results);
}},