- reads settings.json as usual
- if values is provided in settings.json its stored in db.
- if value is provided in db and different as in settings.json, db value is used instead
- if no value is provided a default value is stored in db for the first time.
- React-UI displays and writes settings from and to db
meteor add doichain:settings
import {getSettings } from 'meteor/doichain:settings';
const defaultValue = 'what-ever-it-should-be-in-case whether its in settings.json nor in db)
const settingsValue = getSettings('settings.name',defaultValue);
(works only if current user has admin role according to alanning:roles)
import React from 'react'
import SettingsTable from "meteor/doichain:settings";
const Settings = props => {
return (<SettingsTable/>)
}
export default Settings;
- add reactivity to settings in db (if value is changed in db - should be changed for the application)