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

  1. var model = require('./modelA');
  2. exports.home = function(req, res, next) {
  3. model.find(function(err, docs) {
  4. if (err) return next(err);
  5. res.send(docs);
  6. });
  7. };
  8. exports.modelName = function(req, res) {
  9. res.send('my model name is ' + model.modelName);
  10. };
  11. exports.insert = function(req, res, next) {
  12. model.create({name: 'inserting ' + Date.now()}, function(err, doc) {
  13. if (err) return next(err);
  14. res.send(doc);
  15. });
  16. };