Bom dia, Estou tentando executar o codigo conforme feito no curso.
Mudei apenas a conexao do banco para postgress:
var bconfig = require('smn-pg') (bconfig);
function createDBConnection() {
return bconfig.createConnection({
user: 'postgres',
database: 'casadolivro',
password: 'cancel12',
host: 'localhost',
port: 5432,
max: 10,
idleTimeoutMillis: 30000
});
}
module.exports = function() {
return createDBConnection;
}
app.js:
var app = require('./config/express')();
app.listen(3000, function() {
console.log("servidor rodando");
})
package.json:
{
"name": "casadocodigo",
"version": "1.0.0",
"description": "site da casa do codigo",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "alberto",
"license": "ISC",
"dependencies": {
"ejs": "^2.5.6",
"express": "^4.16.3",
"express-load": "^1.1.15",
"mysql": "^2.13.0",
"pg": "^7.4.1"
}
}
quando tento starta o app.js retorna o erro:
Error: Cannot find module 'express-load'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (E:\casadocodigo\config\express.js:2:12)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)