javascript - Is it possible to write to settings.json in Meteor? -
is possible write settings.json file in meteor? standard practice in storing settings values/variables in meteor framework?
no, writing settings.json
not possible. in deployment solutions source files bundled , not writable, , if – meteor won't automatically pick changes.
to save variable need store in kind of data store. default mongo database natural candidate.
example:
// initialize settings = new meteor.collection('settings'); settings.insert({ _id: 'default', }); // set variable settings.update('default', {$set: { meaningoflife: 42, }}); // variable settings.findone('default').meaningoflife;
Comments
Post a Comment