bigbluebutton-Github/bigbluebutton-html5/imports/startup/server/settings.js

19 lines
504 B
JavaScript
Raw Normal View History

2018-09-19 00:12:16 +08:00
import { Meteor } from 'meteor/meteor';
import fs from 'fs';
import YAML from 'yaml';
2018-09-19 00:12:16 +08:00
const YAML_FILE_PATH = 'assets/app/config/settings.yml';
2018-09-19 00:12:16 +08:00
try {
if (fs.existsSync(YAML_FILE_PATH)) {
const SETTINGS = YAML.parse(fs.readFileSync(YAML_FILE_PATH, 'utf-8'));
2018-09-19 00:12:16 +08:00
Meteor.settings = SETTINGS;
__meteor_runtime_config__.PUBLIC_SETTINGS = SETTINGS.public;
} else {
throw new Error('File doesn\'t exists');
2018-09-19 00:12:16 +08:00
}
} catch (error) {
console.error('Error on load configuration file.', error);
2018-09-19 00:12:16 +08:00
}