diff --git a/lib/config-loader.js b/lib/config-loader.js index 1996b38..8889443 100644 --- a/lib/config-loader.js +++ b/lib/config-loader.js @@ -147,14 +147,18 @@ function loadResourceExtras(resource, fn) { } function addInternalResources(server, basepath, resources, fn) { - var internals = [ - new Files('', { config: { 'public': './public' }, server: server }) - , new ClientLib('dpd.js', { config: { resources: resources }, server: server}) - , new InternalResources('__resources', {config: {configPath: basepath}, server: server}) - , new Dashboard('dashboard', {server: server}) - ]; - async.forEach(internals, loadResourceExtras, function(err) { - fn(err, resources.concat(internals)); + var altPublic = './public-' + server.options.env; + fs.exists(altPublic, function(exists) { + var internals = [ + new Files('', { config: { 'public': exists ? altPublic : './public' }, server: server }) + , new ClientLib('dpd.js', { config: { resources: resources }, server: server}) + , new InternalResources('__resources', {config: {configPath: basepath}, server: server}) + , new Dashboard('dashboard', {server: server}) + ]; + async.forEach(internals, loadResourceExtras, function(err) { + fn(err, resources.concat(internals)); + }); }); + } \ No newline at end of file