Created
January 3, 2017 19:24
-
-
Save romgrk/17b4bd0c573dcb6feba5021e754f0109 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Service = require('node-windows').Service; | |
| var appPath = require('path').join(__dirname,'\\bin\\www'); | |
| // Create a new service object | |
| var svc = new Service({ | |
| name:'PlanetPress NodeJS API', | |
| description: 'PlanetPress API service for quote and orders Web interface.', | |
| script: appPath | |
| }); | |
| // Listen for the "install" event, which indicates the | |
| // process is available as a service. | |
| svc.on('install',function(){ | |
| console.log('Installation OK'); | |
| console.log('Starting service ...'); | |
| svc.start(); | |
| }); | |
| svc.on('start',function(){ | |
| console.log('Service started!'); | |
| }); | |
| svc.on('uninstall',function(){ | |
| console.log('Uninstall complete.'); | |
| console.log('The service exists: ',svc.exists); | |
| }); | |
| console.log('Installing NodeJS service using location :'); | |
| console.log(appPath); | |
| // svc.uninstall(); | |
| svc.install(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment