问题
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);
}},
来源:https://stackoverflow.com/questions/54862193/error-handler-method-did-not-return-a-value-a-promise-or-throw-an-error