Skip to content

Commit

Permalink
sync
Browse files Browse the repository at this point in the history
  • Loading branch information
jonniespratley committed Dec 15, 2014
1 parent 845138d commit 280cb84
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
26 changes: 26 additions & 0 deletions routes/cms-routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,30 @@ module.exports.mount = function (config, app) {
//Connect to database
mongoose.connect(config.mongodb);

// CONNECTION EVENTS
// When successfully connected
mongoose.connection.on('connected', function () {
console.log('Mongoose default connection open to ' + dbURI);
});

// If the connection throws an error
mongoose.connection.on('error',function (err) {
console.log('Mongoose default connection error: ' + err);
});

// When the connection is disconnected
mongoose.connection.on('disconnected', function () {
console.log('Mongoose default connection disconnected');
});

// If the Node process ends, close the Mongoose connection
process.on('SIGINT', function() {
mongoose.connection.close(function () {
console.log('Mongoose default connection disconnected through app termination');
process.exit(0);
});
});

var server = http.createServer(app);

require( './cms-auth' )( config, app );
Expand All @@ -16,6 +40,8 @@ module.exports.mount = function (config, app) {
require( './cms-sockets' )( config, server );
require( './cms-server' )( config, app );



return server.listen(config.port || process.env.PORT, function () {
util.log('App listening on port: ' + config.port + ''.verbose);
util.log(util.inspect(config, {colors: true}));
Expand Down
6 changes: 2 additions & 4 deletions routes/rest.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ var MESSAGES = {
};
var DS = require('jps-ds').DS;
var _ds = new DS({
host: 'angularcms:[email protected]:10089/app19632340',
//host: 'localhost/angular-cms',
//host: 'angularcms:[email protected]:10089/app19632340',
host: 'localhost/angular-cms',
models: {
'groups': {
title: String,
Expand Down Expand Up @@ -193,8 +193,6 @@ var RestResource = {
});
},



//### get
//I handle gathering records dynamically from a call to the v2 api.
get: function (req, res, next) {
Expand Down

0 comments on commit 280cb84

Please sign in to comment.