Permalink
Browse files

change folder structure, use middlewares

  • Loading branch information...
1 parent 65c2864 commit 40a960329a9aacf0a09ca8cb8dc345c2117d942e @madhums committed Dec 25, 2012
View
@@ -32,6 +32,8 @@ Then visit [http://localhost:3000/](http://localhost:3000/)
|__routes.js
|__config.js
|__passport.js (auth config)
+ |__express.js (express.js configs)
+ |__middlewares/ (custom middlewares)
```
If you are looking for a specific feature, please use the issue tracker. I will try to come
View
@@ -6,15 +6,9 @@
var express = require('express')
, mongoStore = require('connect-mongodb')
, flash = require('connect-flash')
- , viewHelpers = require('../app/helpers/view')
+ , viewHelpers = require('./middlewares/view')
-exports.boot = function(app, config, passport){
- bootApplication(app, config, passport)
-}
-
-// App settings and middleware
-
-function bootApplication(app, config, passport) {
+module.exports = function (app, config, passport) {
app.set('showStackError', true)
app.use(express.static(config.root + '/public'))
File renamed without changes.
File renamed without changes.
View
@@ -8,7 +8,7 @@ var mongoose = require('mongoose')
, User = mongoose.model('User')
-exports.boot = function (passport, config) {
+module.exports = function (passport, config) {
// require('./initializer')
// serialize sessions
View
@@ -8,7 +8,7 @@ var express = require('express')
// Load configurations
var env = process.env.NODE_ENV || 'development'
, config = require('./config/config')[env]
- , auth = require('./config/authorization')
+ , auth = require('./config/middlewares/authorization')
, mongoose = require('mongoose')
// Bootstrap db connection
@@ -21,11 +21,11 @@ fs.readdirSync(models_path).forEach(function (file) {
})
// bootstrap passport config
-require('./config/passport').boot(passport, config)
+require('./config/passport')(passport, config)
var app = express()
// express settings
-require('./config/express').boot(app, config, passport)
+require('./config/express')(app, config, passport)
// Bootstrap routes
require('./config/routes')(app, passport, auth)

0 comments on commit 40a9603

Please sign in to comment.