overleaf/services/web/app/coffee/infrastructure/Modules.coffee
2014-09-08 14:23:47 +01:00

13 lines
No EOL
334 B
CoffeeScript

fs = require "fs"
Path = require "path"
MODULE_BASE_PATH = Path.resolve(__dirname + "/../../../modules")
modules = []
for mod in fs.readdirSync(MODULE_BASE_PATH)
modules.push require(Path.join(MODULE_BASE_PATH, mod, "index"))
module.exports = Modules =
applyRouter: (app) ->
for module in modules
module.router?.apply(app)