make loading of module routes more robust

This commit is contained in:
Brian Gough 2017-07-05 11:46:29 +01:00
parent 5ad3fd769d
commit 3e8ad69f3c

View file

@ -17,11 +17,12 @@ module.exports = Modules =
applyRouter: (webRouter, apiRouter) ->
for module in @modules
module.router?.apply(webRouter, apiRouter)
module.router?.apply?(webRouter, apiRouter)
applyNonCsrfRouter: (webRouter, apiRouter) ->
for module in @modules
module.nonCsrfRouter?.apply(webRouter, apiRouter)
module.router?.applyNonCsrfRouter?(webRouter, apiRouter)
viewIncludes: {}
loadViewIncludes: (app) ->