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

776 Views Asked by At

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?

1

There are 1 best solutions below

1
On BEST ANSWER

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.