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

@@ -2,9 +2,11 @@ var message =
'Learn to Code JavaScript and get a Coding Job by Helping Nonprofits';
module.exports = function(app) {
var router = app.Router();
var router = app.loopback.Router();
router.get('/', index);
app.use(router);
function index(req, res, next) {
if (req.user && !req.user.profile.picture) {
req.user.profile.picture =