forked from ptcrealitylab/vuforia-spatial-edge-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwindowsService.js
More file actions
32 lines (25 loc) · 818 Bytes
/
Copy pathwindowsService.js
File metadata and controls
32 lines (25 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
var Service = require('node-windows').Service;
var EventLogger = require('node-windows').EventLogger;
var log = new EventLogger('Reality Server');
log.info('Basic information.');
log.warn('Watch out!');
log.error('Something went wrong.');
// Create a new service object
var svc = new Service({
name: 'Reality Server',
description: 'Real-Time service for Reality Editor',
script: require('path').join(__dirname, 'server.js'),
env: {
name: 'HOME',
value: process.env['admin'] // service is now able to access the user who created its' home directory
}
});
// Listen for the "install" event, which indicates the
// process is available as a service.
svc.on('install', function() {
svc.start();
});
svc.on('alreadyinstalled', function() {
svc.start();
});
svc.install();