Permalink
Browse files

Updated examples

  • Loading branch information...
coreybutler committed Jun 27, 2013
1 parent 4cd9763 commit 10d62505895c23de423685a1a8a69286a8e08a4d
Showing with 49 additions and 50 deletions.
  1. +34 −35 example/install.js
  2. +15 −15 example/uninstall.js
View
@@ -1,35 +1,34 @@
-var Service = require('../').Service;
-
-// Create a new service object
-var svc = new Service({
- name:'Hello World',
- description: 'The nodejs.org example web server.',
- script: require('path').join(__dirname,'helloworld.js'),
- env:{
- name: "NODE_ENV",
- value: "production"
- }
-});
-
-// Listen for the "install" event, which indicates the
-// process is available as a service.
-svc.on('install',function(){
- console.log('\nInstallation Complete\n---------------------');
- svc.start();
-});
-
-// Just in case this file is run twice.
-svc.on('alreadyinstalled',function(){
- console.log('This service is already installed.');
- console.log('Attempting to start it.');
- svc.start();
-});
-
-// Listen for the "start" event and let us know when the
-// process has actually started working.
-svc.on('start',function(){
- console.log(svc.name+' started!\nVisit http://127.0.0.1:3000 to see it in action.\n');
-});
-
-// Install the script as a service.
-svc.install();
+var Service = require('../').Service,
+ svc = new Service({
+ name: 'Hello World',
+ description: 'The nodejs.org example web server.',
+ script: require('path').join(__dirname,'helloworld.js'),
+ template: '/workspace/node-linux/lib/templates/systemv/debian',
+ env:{
+ name: "NODE_ENV",
+ value: "production"
+ }
+ });
+
+// Listen for the "install" event, which indicates the
+// process is available as a service.
+svc.on('install',function(){
+ console.log('\nInstallation Complete\n---------------------');
+ svc.start();
+});
+
+// Just in case this file is run twice.
+svc.on('alreadyinstalled',function(){
+ console.log('This service is already installed.');
+ console.log('Attempting to start it.');
+ svc.start();
+});
+
+// Listen for the "start" event and let us know when the
+// process has actually started working.
+svc.on('start',function(){
+ console.log(svc.name+' started!\nVisit http://127.0.0.1:3000 to see it in action.\n');
+});
+
+// Install the script as a service.
+svc.install();
View
@@ -1,16 +1,16 @@
-var Service = require('../').Service;
-
-// Create a new service object
-var svc = new Service({
- name:'Hello World',
- script: require('path').join(__dirname,'helloworld.js')
-});
-
-// Listen for the "uninstall" event so we know when it's done.
-svc.on('uninstall',function(){
- console.log('Uninstall complete.');
- console.log('The service exists: ',svc.exists);
-});
-
-// Uninstall the service.
+var Service = require('../').Service;
+
+// Create a new service object
+var svc = new Service({
+ name:'Hello World',
+ script: require('path').join(__dirname,'helloworld.js')
+});
+
+// Listen for the "uninstall" event so we know when it's done.
+svc.on('uninstall',function(){
+ console.log('Uninstall complete.');
+ console.log('The service exists: ',svc.exists);
+});
+
+// Uninstall the service.
svc.uninstall();

0 comments on commit 10d6250

Please sign in to comment.