6

Does anyone know a way to have a JavaScript file or set of files always running under IISNode without the need for a client request? The idea would be to have scripts that behave as services, but have them running under IISNode.

Thanks! csh3

csh3
  • 61
  • 3

2 Answers2

0

How about trying node-windows, it allows Node.js applications to run as a windows service. A nice feature is that it also exposes a way to write to the EventLog.

It probably fits your scenario better considering that you need any of the IIS features other than the long running aspect of it.

Hope this points you in more applicable direction.

peteb
  • 18,552
  • 9
  • 50
  • 62
-1

I guess you have some reason to use iisnode, but you are trying to run a service in iis which is not a good idea, if you want to run as service then run as service. how?

if you still insist to use iisnode then options are

use Application Initialization for IIS

Or write a scheduled job that pings your iisnode page

Or use pingdom like service to ping your iisnode application.

mamu
  • 12,184
  • 19
  • 69
  • 92
  • I'm sorry for not being clear. I was saying that the JavaScript files would "behave as services", but they're not full blown services. The reason that I'm experimenting with IISNode is that I want to be able to drop scripts in a folder and have them run. The goal is that they run some initialization before the 1st request. Since the names of the scripts and the scripts themselves can change, pinging would have to be dynamic. Thanks for your answer. I think I'll have to figure out something a bit different. – csh3 Apr 18 '12 at 00:36