Created
January 28, 2013 16:54
-
-
Save Unitech/4657153 to your computer and use it in GitHub Desktop.
Init app express
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.configure(function(){ | |
// config | |
var config = icnf(app.get('env')); | |
app.db = new mongodb.Db(config.mongodb.db, new mongodb.Server(config.mongodb.host, config.mongodb.port, {auto_reconnect: true}), {safe: true}); | |
// info | |
app.set('port', config.port || process.env.PORT || 3000); | |
app.set('views', __dirname + '/views'); | |
app.set('view engine', 'ejs'); | |
app.set('config', config); | |
app.use(cors.header); | |
app.use(express.favicon()); | |
app.use(express.logger('dev')); | |
app.use(express.bodyParser()); | |
app.use(express.methodOverride()); | |
app.use(express.cookieParser('LVLDLce3')); | |
app.use(express.session()); | |
// initialize passport | |
require('./lib/passport')(app); | |
app.use(app.router); | |
app.use(express.static(path.join(__dirname, 'public'))); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment