Skip to content

Instantly share code, notes, and snippets.

@chrisckchang
Created February 25, 2015 00:25
Show Gist options
  • Save chrisckchang/7ebe7680a4dfeb428b0f to your computer and use it in GitHub Desktop.
Save chrisckchang/7ebe7680a4dfeb428b0f to your computer and use it in GitHub Desktop.
Node.js on GAE tutorial - www file
#!/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