Here is an example of running VorlonJS as a service under windows, which should help anyone with similar issues:
Running VorlonJS as a service on Windows.
=========================================
1. Ensure you have NPM installed.
2. Pick a folder to configure this from e.g.
mkdir c:\Development\vorlon\
cd c:\Development\vorlon
3. Install "vorlon" package with npm:
a) Globally (+ linking):
npm install -g vorlon
npm link vorlon
b) OR Locally (not recommended if you wish to be able to call vorlon manually)
npm install vorlon
4. Install "node-windows" package with npm:
a) Globally (+ linking):
npm install -g node-windows
npm link
b) OR Locally (not recommended)
npm install node-windows
5. Create the following files:
VorlonService.install.js:
var Service = require('node-windows').Service;
// Create a new service object
var svc = new Service({
name:'VorlonJSServer',
description:'Vorlon JS Server (port 1337)',
script: require('path').combine(__dirname, 'node_modules\\vorlon\\Server\\server.js')
});
// Listen for the "install" event, which indicates the process is available as a service.
svc.on('install',function(){
"VorlonJS Server Service Installed ... starting service ..."
svc.start();
console.log("... VorlonJS Server Service started.");
});
svc.install();
VorlonService.uninstall.js
var Service = require('node-windows').Service;
// Create a new service object
var svc = new Service({
name:'VorlonJSServer',
description:'Vorlon JS Server (port 1337)',
script:require('path').combine(__dirname, 'node_modules\\vorlon\\Server\\server.js')
});
// Listen for the "install" event, which indicates the process is available as a service.
svc.on('uninstall',function(){
console.log("Uninstall complete.");
console.log("The service exists: " + svc.exists);
});
svc.uninstall();
6. Now you can install the service with "node VorlonService.install.js"
7. You can remove the service again with "node VorlonService.uninstall.js"