I am doing a firebase function connecting to a mysql server, but when performing deploy it returns me error during the process.

error returned

My function

exports.helloWorld = functions.https.onRequest(async (request, response) => {
//response.send("Hello from Firebase!");
var res = {};
const result = await  mysqlssh.connect(
    {
        host: 'xxxxxxxx',
        user: 'xxxxxxx',
        password: 'xxxxxx',
        port: 'xxxxxx'

    },
    {
        host: '127.0.0.1',
        user: 'xxxxxxx',
        password: 'xxxxx',
        database: 'xxxxxxx',
        port:'3306'
    }
).then(client => {
        client.query('SELECT * FROM `dt_dashboard_user`', (error, results, fields) => {
           // if (err) throw err
            console.log(results);
            mysqlssh.close()
            return results;
        })
    })
    .catch(error => {
        console.log(error)
        return error
    })
    response.send(result)

});

0 Answers