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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -