Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
replacing deprecated require.extensions nodejs call with explicit ful…
Browse files Browse the repository at this point in the history
…l paths for require()
  • Loading branch information
lirantal committed Oct 24, 2014
1 parent a799a23 commit 14c5d1b
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 24 deletions.
2 changes: 1 addition & 1 deletion app/controllers/articles.server.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Module dependencies.
*/
var mongoose = require('mongoose'),
errorHandler = require('./errors'),
errorHandler = require('./errors.server.controller.js'),
Article = mongoose.model('Article'),
_ = require('lodash');

Expand Down
8 changes: 4 additions & 4 deletions app/controllers/users.server.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ var _ = require('lodash');
* Extend user's controller
*/
module.exports = _.extend(
require('./users/users.authentication'),
require('./users/users.authorization'),
require('./users/users.password'),
require('./users/users.profile')
require('./users/users.authentication.server.controller.js'),
require('./users/users.authorization.server.controller.js'),
require('./users/users.password.server.controller.js'),
require('./users/users.profile.server.controller.js')
);
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Module dependencies.
*/
var _ = require('lodash'),
errorHandler = require('../errors'),
errorHandler = require('../errors.server.controller.js'),
mongoose = require('mongoose'),
passport = require('passport'),
User = mongoose.model('User');
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/users/users.password.server.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Module dependencies.
*/
var _ = require('lodash'),
errorHandler = require('../errors'),
errorHandler = require('../errors.server.controller.js'),
mongoose = require('mongoose'),
passport = require('passport'),
User = mongoose.model('User'),
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/users/users.profile.server.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Module dependencies.
*/
var _ = require('lodash'),
errorHandler = require('../errors'),
errorHandler = require('../errors.server.controller.js'),
mongoose = require('mongoose'),
passport = require('passport'),
User = mongoose.model('User');
Expand Down
4 changes: 2 additions & 2 deletions app/routes/articles.server.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
/**
* Module dependencies.
*/
var users = require('../../app/controllers/users'),
articles = require('../../app/controllers/articles');
var users = require('../../app/controllers/users.server.controller.js'),
articles = require('../../app/controllers/articles.server.controller.js');

module.exports = function(app) {
// Article Routes
Expand Down
2 changes: 1 addition & 1 deletion app/routes/core.server.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module.exports = function(app) {
// Root routing
var core = require('../../app/controllers/core');
var core = require('../../app/controllers/core.server.controller.js');
app.route('/').get(core.index);
};
2 changes: 1 addition & 1 deletion app/routes/users.server.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var passport = require('passport');

module.exports = function(app) {
// User Routes
var users = require('../../app/controllers/users');
var users = require('../../app/controllers/users.server.controller.js');

// Setting up the users profile api
app.route('/users/me').get(users.me);
Expand Down
8 changes: 1 addition & 7 deletions config/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,5 @@ module.exports = function() {
}
console.log('\x1b[0m');
});

/**
* Add our server node extensions
*/
require.extensions['.server.controller.js'] = require.extensions['.js'];
require.extensions['.server.model.js'] = require.extensions['.js'];
require.extensions['.server.routes.js'] = require.extensions['.js'];

};
2 changes: 1 addition & 1 deletion config/strategies/facebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var passport = require('passport'),
url = require('url'),
FacebookStrategy = require('passport-facebook').Strategy,
config = require('../config'),
users = require('../../app/controllers/users');
users = require('../../app/controllers/users.server.controller.js');

module.exports = function() {
// Use facebook strategy
Expand Down
2 changes: 1 addition & 1 deletion config/strategies/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var passport = require('passport'),
url = require('url'),
GithubStrategy = require('passport-github').Strategy,
config = require('../config'),
users = require('../../app/controllers/users');
users = require('../../app/controllers/users.server.controller.js');

module.exports = function() {
// Use github strategy
Expand Down
2 changes: 1 addition & 1 deletion config/strategies/google.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var passport = require('passport'),
url = require('url'),
GoogleStrategy = require('passport-google-oauth').OAuth2Strategy,
config = require('../config'),
users = require('../../app/controllers/users');
users = require('../../app/controllers/users.server.controller.js');

module.exports = function() {
// Use google strategy
Expand Down
2 changes: 1 addition & 1 deletion config/strategies/linkedin.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var passport = require('passport'),
url = require('url'),
LinkedInStrategy = require('passport-linkedin').Strategy,
config = require('../config'),
users = require('../../app/controllers/users');
users = require('../../app/controllers/users.server.controller.js');

module.exports = function() {
// Use linkedin strategy
Expand Down
2 changes: 1 addition & 1 deletion config/strategies/twitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var passport = require('passport'),
url = require('url'),
TwitterStrategy = require('passport-twitter').Strategy,
config = require('../config'),
users = require('../../app/controllers/users');
users = require('../../app/controllers/users.server.controller.js');

module.exports = function() {
// Use twitter strategy
Expand Down

0 comments on commit 14c5d1b

Please sign in to comment.