This is a test application to implement feature/platform driven app configuration.
example
let ENV = {
APP: {
PLATFORM_CODE: process.env.PLATFORM_CODE || 'EARTH',
FEATURE_NEWS: true
}
};
in ENV you can set PLATFORM and FEATURES Envs.
this file is used to implement your custom featureFlags management.
in FEATURES object you can add all the feature names you need.
example:
const FEATURES = {
WELCOME,
NEWS,
};
featuresFlags object maps the ENV flags into Front-end specific flags; this way we can split / merge ENV flags based on the application needs.
example:
const featuresFlags = {
[WELCOME]: Array('EARTH', 'MOON').includes(ENV.APP.PLATFORM_CODE),
[NEWS]: ENV.APP.FEATURE_NEWS,
};
In featurePages object you can add configurations for pages redirect.
example:
const featurePages = {
'page-a': {
features: [FEATURES.WELCOME], // list of feature that allow the page to be shown
redirectRoute: { // Redirect route in case of FALSE feature flags
routeName: "page-c",
}
},
'page-b': {
features: [FEATURES.FEATURE_NEWS],
redirectRoute: {
routeName: "page-d",
}
}
};
for each property:
property key: Use page names as key propertiesfeatures: add an array of allowed featuresredirectRoute: add an object containing all the data needed to do a proper redirect
You will need the following things properly installed on your computer.
- Git
- Node.js (with npm)
- Ember CLI
- Google Chrome
git clone <repository-url>this repositorycd ember-features-managernpm install
ember serve- Visit your app at http://localhost:4200.
- Visit your tests at http://localhost:4200/tests.
Make use of the many generators for code, try ember help generate for more details
ember testember test --server
npm run lint:hbsnpm run lint:jsnpm run lint:js -- --fix
ember build(development)ember build --environment production(production)
Specify what it takes to deploy your app.