fix use app.use(router) to add sub router

This commit is contained in:
Berkeley Martinez
2015-06-03 16:31:42 -07:00
parent 8165105b29
commit bfd33d8b40
11 changed files with 32 additions and 11 deletions

View File

@@ -1,11 +1,13 @@
module.exports = function(app) {
var router = app.Router();
var router = app.loopback.Router();
var Nonprofit = app.models.Nonprofit;
router.get('/nonprofits/directory', nonprofitsDirectory);
router.get('/nonprofits/:nonprofitName', returnIndividualNonprofit);
app.use(router);
function nonprofitsDirectory(req, res, next) {
Nonprofit.find(
{ where: { estimatedHours: { $gt: 0 } } },