Skip to content

Commit 440ab86

Browse files
committed
Update to make Angular app windows service
1 parent 120a472 commit 440ab86

File tree

3 files changed

+39
-4
lines changed

3 files changed

+39
-4
lines changed

eform-client/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
"pree2e": "webdriver-manager update --standalone false --gecko false",
1111
"e2e": "protractor",
1212
"build": "ng build --aot -prod",
13-
"server": "node server.js"
13+
"server": "node server.js",
14+
"winserver-install": "node svc.js install",
15+
"winserver-uninstall": "node svc.js uninstall"
1416
},
1517
"private": true,
1618
"dependencies": {
@@ -35,7 +37,7 @@
3537
"ng2-dnd": "^4.2.0",
3638
"ngx-bootstrap": "^1.6.6",
3739
"pnotify": "^3.2.0",
38-
"rxjs": "^5.1.0",
40+
"rxjs": "^5.4.2",
3941
"trumbowyg": "^2.5.1",
4042
"ts-helpers": "^1.1.1",
4143
"wowjs": "^1.1.3",

eform-client/src/app/modules/advanced/components/entity-search-pagination/entity-search-pagination.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {Component, EventEmitter, Input, OnChanges, OnInit, Output} from '@angular/core';
2-
import {Observable} from 'rxjs/Observable';
3-
import 'rxjs/add/observable/range';
2+
import { Observable } from 'rxjs/Rx';
43

54
@Component({
65
selector: 'entity-search-pagination',

eform-client/svc.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
var Service = require('node-windows').Service;
2+
3+
// Create a new service object
4+
var svc = new Service({
5+
name: 'eForm angular',
6+
description: 'eForm angular frontend application',
7+
script: 'server.js'
8+
});
9+
10+
// Listen for the "install" event, which indicates the
11+
// process is available as a service.
12+
svc.on('install', function () {
13+
console.log('Installation complete.');
14+
console.log('The service exists: ', svc.exists);
15+
svc.start();
16+
});
17+
18+
// Listen for the "uninstall" event so we know when it's done.
19+
svc.on('uninstall', function () {
20+
console.log('Uninstall complete.');
21+
console.log('The service exists: ', svc.exists);
22+
});
23+
24+
var args = process.argv.slice(2);
25+
switch (args[0]) {
26+
case 'install':
27+
console.log('Service will be installed');
28+
svc.install();
29+
break;
30+
case 'uninstall':
31+
console.log('Service will be uninstalled');
32+
svc.uninstall();
33+
break;
34+
}

0 commit comments

Comments
 (0)