This file contains 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
var validateUnique = function(model, field){ | |
return function(form, field, callback){ | |
var model = db.model(model); | |
var q = {}; | |
q[field] = form.data[field]; | |
model.findOne(q, 'name', function(err, doc){ | |
}); | |
}; |
This file contains 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
// libs | |
var flatiron = require('flatiron'); | |
var fs = require('fs'); | |
// create app | |
var app = flatiron.app; | |
app.use(flatiron.plugins.http); | |
// router logic | |
app.router.get('/', function () { |