Created
February 25, 2015 00:25
-
-
Save chrisckchang/7ebe7680a4dfeb428b0f to your computer and use it in GitHub Desktop.
Node.js on GAE tutorial - www file
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
#!/usr/bin/env node | |
var debug = require('debug')('gcpNode'); | |
var app = require('../app'); | |
var mongodb = require('mongodb'); | |
app.set('port', process.env.PORT || 3000); | |
mongodb.MongoClient.connect(MONGODB_URI, function(err, db) { | |
// do error handling here | |
if(err) throw err; | |
module.exports = db | |
var server = app.listen(app.get('port'), function() { | |
debug('Express server listening on port ' + server.address().port); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment