I am trying to create an app using node, in which users can schedule certain cron jobs ,the setting for these job I am fetching from the users and saving it to mongoDB .I need my app to be such that users can start stop these jobs whenever they want . I have a class created which is something like this
Class Croncreator {
constructor () {Creates the cron job}
startCron ()
stropCron()}
Now all this is working ,but I cannot wrap my head around how do I manage this in a multi user environment? Do I create an instance of this class in my express route for "/api/savecronjob" ,if yes then how do I manage the start stop feature .Considering the fact that 1 user may be creating multiple jobs a time and switching them on off when ever he wants.