简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM