Search code examples
phpservicesails.jsdnode

The right way to call a service function on sails.js as soon as I start sails.js


I want that my sails.js application communicates with a php client. I've create a new dnode server service in sails.js for that. This service can start the dnode server. Currently I start the server with a controller by a request, but the server should always listen for clients. What is the right way to start the server as soon as I start sails.js, but only if the rest was fully charged?


Solution

  • I'm not familiar with dnoe but I think you want to use the bootstrap function inside of the config folder. it gets executed right before the server lifts with your models and services ready to use.