Andrew Winter
Andrew Winter

Reputation: 1146

Location for scheduled tasks in SailsJS

I need to build a few tasks that import various data from outside APIs in my SailsJS project. I was thinking of using laterJS (unless there's a better option).

Is there a best practice for the location and loading of these "task" files?

Upvotes: 2

Views: 551

Answers (1)

Paweł Wszoła
Paweł Wszoła

Reputation: 1106

The place where I think it should go is file config/bootstrap.js.

Description of this file from sails-docs:

This is an asynchronous boostrap function that runs before your Sails app gets lifted (i.e. > starts up). This gives you an opportunity to set up your data model, run jobs, or perform some special logic.

Upvotes: 1

Related Questions