Created
June 1, 2014 04:05
-
-
Save tybenz/7f35e9a1c115efc0b23f to your computer and use it in GitHub Desktop.
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 BananaModel = require( '../models/banana.js' ); | |
var BananaController = { | |
index: function( req, res, next ) { | |
res.send( BananaModel.getAll() ); | |
} | |
create: function( req, res, next ) { | |
var banana = BananaModel.new({ | |
weight: req.params.weight, | |
length: req.params.length, | |
}) | |
.save(); | |
res.send( banana ); | |
} | |
}; | |
module.exports = BananaController; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment