mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-28 00:06:53 +01:00
24 lines
598 B
JavaScript
24 lines
598 B
JavaScript
'use strict';
|
|
|
|
module.exports = () => {
|
|
let apps = [];
|
|
|
|
return {
|
|
upsert: app => {
|
|
apps.push(app);
|
|
return Promise.resolve();
|
|
},
|
|
getApplications: () => Promise.resolve(apps),
|
|
getApplication: appName => {
|
|
const app = apps.filter(a => a.appName === appName)[0];
|
|
if (!app) {
|
|
throw new Error(`Could not find app=${appName}`);
|
|
}
|
|
return app;
|
|
},
|
|
deleteApplication: appName => {
|
|
apps = apps.filter(app => app.appName !== appName);
|
|
},
|
|
};
|
|
};
|