Bom dia.
Ao executar a aplicação retorna o erro abaixo:
var mysql = require('mysql');
function createDBConnection(){
if (!process.env.NODE_ENV || process.env.node == 'dev') {
return mysql.createConnection({
host: 'localhost',
user: '<>',
password: '<>',
database: 'casadocodigonodejs'
});
}
if (process.env.NODE_ENV == 'test') {
return mysql.createConnection({
host: 'localhost',
user: '<>,
password: '<>',
database: 'casadocodigonodejs_teste'
});
}
}
module.exports = function(){
return createDbConnection;
}
NodeJs\casadocodigo\app\infra\connectionFactory.js:35 return createDbConnection; ^
ReferenceError: createDbConnection is not defined