Regarding Init Function for sailsjs

11 views
Skip to first unread message

navdeep jain

unread,
Jul 13, 2015, 12:39:45 PM7/13/15
to sai...@googlegroups.com
Hi,

If I have an initializer function which should be called as soon as app starts running, where should I put it in sailsjs structure and how to call initializer function?

Thanks,
Navdeep

Robert Main

unread,
Jul 13, 2015, 12:41:56 PM7/13/15
to navdeep jain, sai...@googlegroups.com

bootstrap. js is likely a good place for this. Make sure you return the callback though or your app won't lift.

coryrob...@gmail.com

unread,
Jul 13, 2015, 1:49:54 PM7/13/15
to navdeep jain, sai...@googlegroups.com
Look into your grunt file - everything is initialized through grunt on app lift.

Sent from my iPhone

navdeep jain

unread,
Jul 13, 2015, 1:50:22 PM7/13/15
to sai...@googlegroups.com, jain0...@gmail.com
hey, I tried the same first. But mistake was I was defining init function in controller. It should be in a service. But, yes it should be bootstrap.

Robert Main

unread,
Jul 14, 2015, 1:26:34 AM7/14/15
to coryrob...@gmail.com, sai...@googlegroups.com, navdeep jain

Nope. The grunt file is for assets.

Reply all
Reply to author
Forward
0 new messages