Search code examples
javascriptnode.jsmongodbloopback

What's the most appropriate way to load config parameters with Loopback?


I started messing around with Loopback recently and I'm not quite sure how to load config parameters from MongoDB or Redis. I didn't want to make it asynchronous reqs all the time. Not sure how to proceed


Solution

  • In a recent project I was working on, we decided to cache all the config files from the Database (MongoDb) once the app started running and whenever we decided to update the config properties in the database we would refresh the cache. This way, we needed not to make asynchronous calls after the cache was updated. Maybe this style could work in your project.