mirror of
https://github.com/nasa/openmct.git
synced 2025-05-31 06:31:04 +00:00
[API] Remove bundles.json
...and make its usage optional.
This commit is contained in:
parent
1443ab61e3
commit
72c721b605
34
app.js
34
app.js
@ -40,20 +40,26 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Override bundles.json for HTTP requests
|
// Override bundles.json for HTTP requests
|
||||||
app.use('/' + BUNDLE_FILE, function (req, res) {
|
//app.use('/' + BUNDLE_FILE, function (req, res) {
|
||||||
var bundles = JSON.parse(fs.readFileSync(BUNDLE_FILE, 'utf8'));
|
// var bundles;
|
||||||
|
//
|
||||||
// Handle command line inclusions/exclusions
|
// try {
|
||||||
bundles = bundles.concat(options.include);
|
// bundles = JSON.parse(fs.readFileSync(BUNDLE_FILE, 'utf8'));
|
||||||
bundles = bundles.filter(function (bundle) {
|
// } catch (e) {
|
||||||
return options.exclude.indexOf(bundle) === -1;
|
// bundles = [];
|
||||||
});
|
// }
|
||||||
bundles = bundles.filter(function (bundle, index) { // Uniquify
|
//
|
||||||
return bundles.indexOf(bundle) === index;
|
// // Handle command line inclusions/exclusions
|
||||||
});
|
// bundles = bundles.concat(options.include);
|
||||||
|
// bundles = bundles.filter(function (bundle) {
|
||||||
res.send(JSON.stringify(bundles));
|
// 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
|
// Expose everything else as static files
|
||||||
app.use(express['static']('.'));
|
app.use(express['static']('.'));
|
||||||
|
38
bundles.json
38
bundles.json
@ -1,38 +0,0 @@
|
|||||||
[
|
|
||||||
"platform/framework",
|
|
||||||
"platform/core",
|
|
||||||
"platform/representation",
|
|
||||||
"platform/commonUI/about",
|
|
||||||
"platform/commonUI/edit",
|
|
||||||
"platform/commonUI/dialog",
|
|
||||||
"platform/commonUI/formats",
|
|
||||||
"platform/commonUI/general",
|
|
||||||
"platform/commonUI/inspect",
|
|
||||||
"platform/commonUI/mobile",
|
|
||||||
"platform/commonUI/themes/espresso",
|
|
||||||
"platform/commonUI/notification",
|
|
||||||
"platform/containment",
|
|
||||||
"platform/execution",
|
|
||||||
"platform/telemetry",
|
|
||||||
"platform/features/clock",
|
|
||||||
"platform/features/events",
|
|
||||||
"platform/features/imagery",
|
|
||||||
"platform/features/layout",
|
|
||||||
"platform/features/pages",
|
|
||||||
"platform/features/plot",
|
|
||||||
"platform/features/scrolling",
|
|
||||||
"platform/features/timeline",
|
|
||||||
"platform/forms",
|
|
||||||
"platform/identity",
|
|
||||||
"platform/persistence/aggregator",
|
|
||||||
"platform/persistence/local",
|
|
||||||
"platform/persistence/queue",
|
|
||||||
"platform/policy",
|
|
||||||
"platform/entanglement",
|
|
||||||
"platform/search",
|
|
||||||
"platform/status",
|
|
||||||
|
|
||||||
"example/imagery",
|
|
||||||
"example/eventGenerator",
|
|
||||||
"example/generator"
|
|
||||||
]
|
|
@ -130,7 +130,20 @@ define(
|
|||||||
// Load all bundles named in the referenced file. The file is
|
// Load all bundles named in the referenced file. The file is
|
||||||
// presumed to be a JSON file
|
// presumed to be a JSON file
|
||||||
function loadBundlesFromFile(listFile) {
|
function loadBundlesFromFile(listFile) {
|
||||||
return getJSON(listFile).then(loadBundlesFromArray);
|
function handleError(err) {
|
||||||
|
$log.info([
|
||||||
|
"No external bundles loaded;",
|
||||||
|
"could not load bundle listing in",
|
||||||
|
listFile,
|
||||||
|
"due to error",
|
||||||
|
err.status,
|
||||||
|
err.statusText
|
||||||
|
].join(' '));
|
||||||
|
return loadBundlesFromArray([]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return getJSON(listFile)
|
||||||
|
.then(loadBundlesFromArray, handleError);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Array.isArray(bundles) ? loadBundlesFromArray(bundles) :
|
return Array.isArray(bundles) ? loadBundlesFromArray(bundles) :
|
||||||
|
Loading…
x
Reference in New Issue
Block a user