From ed454df97d2e3ea2014264d9e01936eb1297cffb Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Fri, 8 Jan 2016 15:45:30 -0800 Subject: [PATCH] [API Refactor] Uncomment out erroneous change --- app.js | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/app.js b/app.js index 3063c10314..e05f90d77a 100644 --- a/app.js +++ b/app.js @@ -40,26 +40,26 @@ } // Override bundles.json for HTTP requests - //app.use('/' + BUNDLE_FILE, function (req, res) { - // var bundles; - // - // try { - // bundles = JSON.parse(fs.readFileSync(BUNDLE_FILE, 'utf8')); - // } catch (e) { - // bundles = []; - // } - // - // // Handle command line inclusions/exclusions - // bundles = bundles.concat(options.include); - // bundles = bundles.filter(function (bundle) { - // return options.exclude.indexOf(bundle) === -1; - // }); - // bundles = bundles.filter(function (bundle, index) { // Uniquify - // return bundles.indexOf(bundle) === index; - // }); - // - // res.send(JSON.stringify(bundles)); - //}); + app.use('/' + BUNDLE_FILE, function (req, res) { + var bundles; + + try { + bundles = JSON.parse(fs.readFileSync(BUNDLE_FILE, 'utf8')); + } catch (e) { + bundles = []; + } + + // Handle command line inclusions/exclusions + bundles = bundles.concat(options.include); + bundles = bundles.filter(function (bundle) { + return options.exclude.indexOf(bundle) === -1; + }); + bundles = bundles.filter(function (bundle, index) { // Uniquify + return bundles.indexOf(bundle) === index; + }); + + res.send(JSON.stringify(bundles)); + }); // Expose everything else as static files app.use(express['static']('.'));