ih-portal
Version:
A project for connecting interaction hub services with catalyst-ui components
209 lines (202 loc) • 4.96 kB
JavaScript
/* eslint-disable no-console */
const convict = require('convict');
const fs = require('fs');
const path = require('path');
const env = process.env.NODE_ENV || 'development';
const conf = convict({
env: {
doc: 'The application environment.',
format: ['production', 'development', 'test', 'local'],
default: 'development',
env: 'NODE_ENV',
},
username: {
doc: 'Endpoint username',
default: '',
env: 'ENDPOINT_USERNAME',
},
password: {
doc: 'Endpoint password',
default: '',
env: 'ENDPOINT_PASSWORD',
},
changeReadStatusUrl: {
doc: 'The REST Endpoint to mark a notification as read',
default: '',
env: 'CHANGE_READ_STATUS_URL',
},
getAcademicProfileUrl: {
doc: 'The REST Endpoint to get Academic Profile data',
default: '',
env: 'ACADEMIC_PROFILE_URL',
},
getAcceptDeclineAwardUrl: {
doc: '',
default: '',
env: 'ACCEPTDENY_URL',
},
getAccountInquiryUrl: {
doc: '',
default: '',
env: 'ACCOUNTINQUIRY_URL',
},
getClassScheduleUrl: {
doc: '',
default: '',
env: 'CLASS_SCHEDULE_URL',
},
getMakePaymentUrl: {
doc: '',
default: '',
env: 'MAKEPAYMENT_URL',
},
getTermBillUrl: {
doc: '',
default: '',
env: 'TERMBILL_URL',
},
getApplicationsUrl: {
doc: 'The REST Endpoint to get Applications data',
default: '',
env: 'APPLICATIONS_URL',
},
getChecklistUrl: {
doc: 'The REST Endpoint to get financial aid',
default: '',
env: 'CHECKLIST_URL',
},
getCoursesUrl: {
doc: 'The REST Endpoint to get courses',
default: '',
env: 'COURSES_URL',
},
getDegreeAuditPageletName: {
doc: 'Pagelet name for degree audit navigation collection',
default: '',
env: 'DEGREE_AUDIT_PAGELET_NAME',
},
getDueNowDays: {
doc: 'Number of days from today when a balance is due to be paid',
default: '15',
env: 'DUE_NOW_DAYS',
},
getEventsUrl: {
doc: 'The REST Endpoint to call for notification events',
default: '',
env: 'EVENTS_URL',
},
getFeatureTabs: {
doc: 'enable bottom tabs',
default: false,
env: 'FEATURE_TABS',
},
getFeatureHeaderPhoto: {
doc: 'enable profile photo in header',
default: false,
env: 'FEATURE_HEADER_PHOTO',
},
getFinancialAidUrl: {
doc: 'The REST Endpoint to get financial aid',
default: '',
env: 'FINANCIAL_AID_URL',
},
getHomeUrl: {
doc: 'URL for logo',
default: '#',
env: 'HOME_URL',
},
getLauncherPageletName: {
doc: 'Pagelet name for launcher navigation collection as published in ih portal',
default: '',
env: 'LAUNCHER_PAGELET_NAME',
},
getLogoutUrl: {
doc: 'URL for logout',
default: '#',
env: 'LOGOUT_URL',
},
getLovUrl: {
doc: 'The REST Endpoint to get list of values',
default: '',
env: 'LOV_URL',
},
getNotificationsUrl: {
doc: 'The REST Endpoint to get notifications',
default: '',
env: 'NOTIFICATIONS_URL',
},
getPageletBuilderUrl: {
doc: 'URL for native portal pagelets',
default: '',
env: 'PAGELET_BUILDER_URL',
},
getPageletUrl: {
doc: 'The REST Endpoint to get pagelets for navigation collection',
default: '',
env: 'PAGELET_URL',
},
getPictureUrl: {
doc: 'The REST Endpoint for the profile picture',
default: '',
env: 'PICTURE_URL',
},
getPendingFinancialAidUrl: {
doc: 'The REST Endpoint for the profile picture',
default: '',
env: 'PENDING_FINANCIAL_AID_URL',
},
getProfileLinksPageletName: {
doc: 'Pagelet name for profile links navigation collection',
default: '',
env: 'PROFILE_LINKS_PAGELET_NAME',
},
getProfileUrl: {
doc: 'The REST Endpoint for profile info.',
default: '',
env: 'PROFILE_URL',
},
getScheduleUrl: {
doc: 'The REST Endpoint to get schedule',
default: '',
env: 'SCHEDULE_URL',
},
getViewScheduleUrl: {
doc: 'The REST Endpoint to get schedule',
default: '',
env: 'VIEW_SCHEDULE_URL',
},
getServiceIndicatorsUrl: {
doc: 'The REST Endpoint to get service Indicators',
default: '',
env: 'SERVICE_INDICATORS_URL',
},
getStudentAccountUrl: {
doc: 'The REST Endpoint to get student accoount data',
default: '',
env: 'STUDENT_ACCOUNT_URL',
},
getSubjectsUrl: {
doc: 'The REST Endpoint to get subjects',
default: '',
env: 'SUBJECTS_URL',
},
ucidLookupUrl: {
doc: 'The REST Endpoint to looup EMPLID from UCID',
default: '',
env: 'UCID_LOOKUP_URL',
},
getActivityGuideUrl: {
doc: 'The REST Endpoint to get Activity Guide data',
default: '',
env: 'ACTIVITY_GUIDE_URL',
},
});
const asset = path.join(__dirname, 'assets/', env + '.json');
if (fs.existsSync(asset)) {
conf.loadFile(asset);
} else {
console.error('Config file not found at location: ', asset);
console.log('Current env: ', env);
}
conf.validate();
module.exports = conf;