You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

20 lines
443 B

var model = require('./modelA');
exports.home = function(req, res, next) {
model.find(function(err, docs) {
if (err) return next(err);
res.send(docs);
});
};
exports.modelName = function(req, res) {
res.send('my model name is ' + model.modelName);
};
exports.insert = function(req, res, next) {
model.create({name: 'inserting ' + Date.now()}, function(err, doc) {
if (err) return next(err);
res.send(doc);
});
};