Skip to content

Instantly share code, notes, and snippets.

Dave Gauer ratfactor

Block or report user

Report or block ratfactor

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am ratfactor on github.
  • I am ratfactor (https://keybase.io/ratfactor) on keybase.
  • I have a public key whose fingerprint is 9365 7CD8 06A1 C1A5 63F8 7C4E FCD6 FB97 7B08 8B91

To claim this, I am signing this object:

@ratfactor
ratfactor / server.js
Created Oct 14, 2013
An example of using Mongoose for Node.js to implement a toy blog application in Node.js.
View server.js
var mongoose = require('mongoose');
var postSchema = new mongoose.Schema({ title: String, body: String, date: Date });
var Post = mongoose.model('Post', postSchema);
mongoose.connect('mongodb://localhost/blog');
var db = mongoose.connection;
db.once('open', function(){ startServer(); });
function startServer(){
var connect = require('connect');
You can’t perform that action at this time.