Skip to content

Commit 120a472

Browse files
committed
Midleware update for IIS deploying
1 parent 341f769 commit 120a472

File tree

2 files changed

+26
-16
lines changed

2 files changed

+26
-16
lines changed

eform-client/package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
},
1515
"private": true,
1616
"dependencies": {
17-
"@angular/animations": "^4.2.3",
18-
"@angular/common": "^4.2.3",
19-
"@angular/compiler": "^4.2.3",
20-
"@angular/core": "^4.2.3",
21-
"@angular/forms": "^4.2.3",
22-
"@angular/http": "^4.2.3",
23-
"@angular/platform-browser": "^4.2.3",
24-
"@angular/platform-browser-dynamic": "^4.2.3",
25-
"@angular/router": "^4.2.3",
17+
"@angular/animations": "^4.2.4",
18+
"@angular/common": "^4.2.4",
19+
"@angular/compiler": "^4.2.4",
20+
"@angular/core": "^4.2.4",
21+
"@angular/forms": "^4.2.4",
22+
"@angular/http": "^4.2.4",
23+
"@angular/platform-browser": "^4.2.4",
24+
"@angular/platform-browser-dynamic": "^4.2.4",
25+
"@angular/router": "^4.2.4",
2626
"bootstrap": "^3.3.7",
2727
"bootstrap-datepicker": "^1.6.4",
2828
"bootstrap-timepicker": "^0.5.2",
@@ -43,7 +43,7 @@
4343
},
4444
"devDependencies": {
4545
"@angular/cli": "^1.1.2",
46-
"@angular/compiler-cli": "^4.2.3",
46+
"@angular/compiler-cli": "^4.2.4",
4747
"@types/jasmine": "2.5.38",
4848
"@types/node": "~6.0.60",
4949
"codelyzer": "~2.0.0",

eform-client/server.js

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,37 @@ const express = require('express');
22
const compression = require('compression');
33
const path = require('path');
44
var httpProxy = require('http-proxy');
5-
65
const app = express();
6+
const defaultPort = 3000;
77

88
// proxy
99
var apiProxy = httpProxy.createProxyServer();
1010
var apiForwardingUrl = 'http://localhost:5000/';
11+
apiProxy.on('error', function(e) {
12+
console.error('Error:');
13+
console.info(e);
14+
console.log('-------------------------------------');
15+
});
1116

1217
// gzip
1318
app.use(compression());
14-
1519
app.use(express.static(__dirname + '/dist'));
1620

1721
// api handler
1822
app.all('/api/*', function (req, res) {
19-
apiProxy.web(req, res, {target: apiForwardingUrl});
23+
try {
24+
apiProxy.web(req, res, {target: apiForwardingUrl});
25+
} catch (ex) {
26+
return next(ex)
27+
}
2028
});
2129

2230
// so that PathLocationStrategy can be used
23-
app.get('/*', function (req, res) {
31+
app.all('/*', function (req, res) {
2432
res.sendFile(path.join(__dirname + '/dist/index.html'));
2533
});
2634

27-
// Start the app by listening on the default
28-
app.listen(process.env.PORT || 80);
35+
// Start the app by listening
36+
app.listen(defaultPort, function () {
37+
console.log('Application started on port: ' + defaultPort);
38+
});

0 commit comments

Comments
 (0)