After my recent node battle, I knew the war was not over. I still needed to set up my node script to run in the background. I know with Javascript be an event based I should be able to create a chron job for checking when ever a new signup on the form happens, I should be able to send an invite.
I first started with the forever npm package but similarly with my original requirements for running the unstable version of node, I was unable to use that package, as it is not updated for that.
I then found a StackOverflow question on running the code in an interval. As I thought, this was pretty easy. I am impressed or frustrated with node at the same time, mainly because its not Ruby. In the same vain is not too bad and I can see myself using more in the future for small scripts as the community includes some of the smartest programmers out there and can only increase my experience knowing yet another server side language.
My Code:
No comments:
Post a Comment