Skip to content

Commit

Permalink
ajustes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nelson Carneiro committed May 26, 2015
1 parent dcb187a commit 5f33e71
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 27 deletions.
2 changes: 1 addition & 1 deletion config/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ module.exports = function (db) {
app.set('views', './app/views');

// Enable logger (morgan)
app.use(morgan(logger.getLogFormat(), logger.getLogOptions()));
//app.use(morgan(logger.getLogFormat(), logger.getLogOptions()));

// Environment dependent middleware
if (process.env.NODE_ENV === 'development') {
Expand Down
4 changes: 2 additions & 2 deletions config/mysql.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var Sequelize = require('sequelize'),

var db = {};

var sequelize = new Sequelize(config.db.db, config.db.user, config.db.pass, {host: config.db.host, "dialect": "mysql" });
var sequelize = new Sequelize(config.db.db, config.db.user, config.db.pass, { logging: false, host: config.db.host, "dialect": "mysql" });

fs
.readdirSync(__dirname + '/../app/models')
Expand All @@ -29,7 +29,7 @@ db.Sequelize = Sequelize;

sequelize.query('SET FOREIGN_KEY_CHECKS = 0')
.then(function(){
return sequelize.sync({ force: true }).catch(function(err){
return sequelize.sync(/*{ force: true }*/).catch(function(err){
if(err)
console.error('Could not connect to MySQL!', err);
});
Expand Down
2 changes: 0 additions & 2 deletions config/passport.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ module.exports = function() {

// Deserialize sessions
passport.deserializeUser(function(id, done) {
console.log('oi1');
User.findById(id).then(function(user) {

done(null, user);
});
});
Expand Down
22 changes: 0 additions & 22 deletions server.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,9 @@
'use strict';
/**
* Module dependencies.
*/
var init = require('./config/init')(),
config = require('./config/config'),
// mongoose = require('mongoose'),
chalk = require('chalk'),
db = require('./config/mysql');

/**
* Main application entry file.
* Please note that the order of loading is important.
*/

// Bootstrap db connection
//var db = mongoose.connect(config.db.uri, config.db.options, function(err) {
// if (err) {
// console.error(chalk.red('Could not connect to MongoDB!'));
// console.log(chalk.red(err));
// }
//});
//mongoose.connection.on('error', function(err) {
// console.error(chalk.red('MongoDB connection error: ' + err));
// process.exit(-1);
// }
//);

// Init the express application
var app = require('./config/express')(db);

Expand Down

0 comments on commit 5f33e71

Please sign in to comment.