rm-components
Version:
The default blueprint for ember-cli addons.
64 lines (60 loc) • 1.63 kB
JavaScript
function grabDashboardUrl(env) {
switch (env) {
case 'development':
return 'http://localhost:4205';
case 'remote_development':
return 'https://rm-dashboard-develop.firebaseapp.com';
case 'staging':
return 'https://rm-dashboard-staging.firebaseapp.com';
case 'production':
return 'https://dashboard-raisemore.com';
case 'test':
return '';
default:
throw `Cannot find environment ${env}`;
}
}
function grabStoreUrl(env) {
switch (env) {
case 'development':
return 'http://localhost:4233';
case 'remote_development':
return 'https://rm-store-development.firebaseapp.com';
case 'staging':
return 'https://rm-store-staging.firebaseapp.com';
case 'production':
return 'https://store-raisemore.com';
case 'test':
return '';
default:
throw `Cannot find environment ${env}`;
}
}
function grabWwwUrl(env) {
switch (env) {
case 'development':
return 'http://localhost:4211';
case 'remote_development':
return 'https://rm-www-development.firebaseapp.com';
case 'staging':
return 'https://rm-www-staging.firebaseapp.com';
case 'production':
return 'https://raisemore.com';
case 'test':
return '';
default:
throw `Cannot find environment ${env}`;
}
}
export default function rmLink(app, env) {
switch (app.toLowerCase().trim()) {
case 'dashboard':
return grabDashboardUrl(env);
case 'store':
return grabStoreUrl(env);
case 'www':
return grabWwwUrl(env);
default:
throw `Cannot find link to ${app}`;
}
}