Created
June 5, 2014 04:05
-
-
Save sbruchmann/3c54c82975310d6bccb0 to your computer and use it in GitHub Desktop.
Feathers.js bug: Service#create gets called twice
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
'use strict'; | |
var feathers = require('feathers'); | |
var rubberduck = require('rubberduck'); | |
var tasks = []; | |
var emitter = rubberduck.emitter(tasks).punch('push'); | |
emitter.on('beforePush', function(args, instance) { | |
console.log(new Date(), 'About to push ' + args[0]); | |
}); | |
feathers() | |
.configure(feathers.rest()) | |
.use('/tasks', { | |
create: function(data, params, done) { | |
console.log('create task'); | |
tasks.push(data); | |
done(null, data); | |
} | |
}) | |
.listen(3000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment