Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #42 from azulus/manual_module_dirs

Updating matador to mount public directories for new modules
  • Loading branch information...
commit cae78b745eabc1d0a4873b4f4cf472017469aeef 2 parents 3170237 + b35e7d3
@azulus authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 src/matador.js
View
10 src/matador.js
@@ -80,13 +80,14 @@ module.exports.createApp = function (baseDir, configuration, options) {
}
return objCache[subdir][name]
}
+ , mountPublicDir = function (moduleDir) {
+ var directory = dir + '/public'
+ path.existsSync(directory) && app.use(express.static(directory))
+ }
app.set('base_dir', appDir)
app.set('public', appDir + '/public')
- v(appDirs).each(function (dir) {
- var directory = dir + '/public'
- path.existsSync(directory) && app.use(express.static(directory))
- })
+ v(appDirs).each(mountPublicDir)
app.controllers = {
Base: require('./BaseController')(app)
@@ -94,6 +95,7 @@ module.exports.createApp = function (baseDir, configuration, options) {
app.addModulePath = function (dir) {
appDirs.push(dir)
+ mountPublicDir(dir)
}
app.mount = function () {
Please sign in to comment.
Something went wrong with that request. Please try again.