Reputation: 659
I have downloaded the node-oauth2-server with MongoDB example and have it running. I have MongoDb running as a Windows Service. This is the code at the Git site, https://github.com/pedroetb/node-oauth2-server-mongo-example.
In the Readme section, "Checking example data" it says, "You can call the loadExampleData function at model.js in order to create these entries automatically, and dump function to inspect the database content."
I see the code but do not know how to run it. This is probably a simple step but I am fairly new to node and need some help with these basics". Please let me know how to run this function if you know how.
Upvotes: 2
Views: 385
Reputation: 659
Easier than I thought. I simply added () to the end of the loadExampleData function and started the server. This caused the loadExampleData function to execute on startup and load the data. Just had to remove the () after running once so that the data does not load each time. var loadExampleData = function() { load functionality }(); ^ | Added the () and removed after loading once.
Upvotes: 1