Error: handler method did not return a value, a pr

2019-08-19 17:11发布

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);   
    }},

标签: hapi
0条回答
登录 后发表回答