MongoDB / Meteor / Export MONGO_URL to deployed applications

后端 未结 5 1510
忘了有多久
忘了有多久 2020-12-09 13:48

I tried to export a settings.json as documented in the meteor.js documentation in order to connect my Meteor.js app with an external MongoHQ database :

{
            


        
5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-09 14:22

    Create a lib folder under the server folder and write:

    Meteor.settings = { //your settings };
    

    According to documentation everything inside a folder named lib will be executed before anything, so this way we ensure that no code will be execute before this, preventing errors from accessing Metrics that don't exist.

    If you're already using the lib folder you've to named right to run before anything else that might conflict, check the docs about it.

    Enjoy.

提交回复
热议问题