Skip to content

Commit

Permalink
Backend: Maintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
winwiz1 committed Feb 21, 2020
1 parent d366ed3 commit d6a47f8
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 58 deletions.
12 changes: 6 additions & 6 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"express": "4.17.1",
"express-static-gzip": "^2.0.6",
"helmet": "^3.21.2",
"http-proxy-middleware": "^0.20.0",
"http-proxy-middleware": "^1.0.0",
"node-cache": "^5.1.0",
"node-fetch": "^2.6.0",
"serve-favicon": "^2.5.0",
Expand All @@ -54,8 +54,8 @@
"@types/express": "4.17.2",
"@types/helmet": "^0.0.45",
"@types/http-proxy-middleware": "^0.19.3",
"@types/jest": "25.1.2",
"@types/node": "13.7.1",
"@types/jest": "25.1.3",
"@types/node": "13.7.4",
"@types/node-cache": "^4.2.5",
"@types/node-fetch": "2.5.4",
"@types/serve-favicon": "^2.5.0",
Expand All @@ -68,9 +68,9 @@
"mkdirp": "^1.0.3",
"rimraf": "^3.0.2",
"supertest": "^4.0.2",
"ts-jest": "25.2.0",
"tslib": "1.10.0",
"ts-jest": "25.2.1",
"tslib": "1.11.0",
"tslint": "6.0.0",
"typescript": "3.7.5"
"typescript": "3.8.2"
}
}
2 changes: 1 addition & 1 deletion server/src/api/types/SampleTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Types related to data received from cloud API service
***********************************************************************/

// The 'main' or 'central' data piece fnullrom the response
// The 'main' or 'central' data piece from the response
// provided by API server
export class SampleRetrievalData {
readonly name?: string;
Expand Down
11 changes: 6 additions & 5 deletions server/src/srv/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import * as express from "express";
import nodeFetch from "node-fetch";
import * as helmet from "helmet";
import * as expressStaticGzip from "express-static-gzip";
import proxy = require("http-proxy-middleware");
import favicon = require("serve-favicon");
import * as SPAs from "../../config/spa.config";
import { CustomError, handleErrors } from "../utils/error";
import { logger } from "../utils/logger";
import { SampleController } from "../api/controllers/SampleController";
const { createProxyMiddleware } = require("http-proxy-middleware");

export enum StaticAssetPath {
// The path to static assets served by Express needs to be
Expand Down Expand Up @@ -62,7 +62,7 @@ class Server {
}

private addRoutes(): void {
// Redirect to the landing page of SPA that has 'redirect: true'
// Redirect to the landing page of the SPA that has 'redirect: true'
this.m_app.get("/", (_req, res, next) => {
if (Server.s_useDevWebserver) {
// Get the resourse from dev server
Expand Down Expand Up @@ -101,7 +101,7 @@ class Server {
// Proxy to devserver ws:// protocol
if (Server.s_useDevWebserver) {
this.m_app.use("/sockjs-node",
proxy({ target: Server.s_urlDevWebserver, changeOrigin: true, ws: true })
createProxyMiddleware({ target: Server.s_urlDevWebserver, changeOrigin: true, ws: true })
);
}

Expand Down Expand Up @@ -160,7 +160,7 @@ class Server {
}

// If there are two SPAs in spa.config.js called 'first and 'second',
// then returns string: "(first)|(second)"
// then returns string: "(first)|(second)"
private static getLandingPages(): string {
const entryPoints = SPAs.getNames();
let ret: string = "";
Expand Down Expand Up @@ -188,12 +188,13 @@ class Server {

private readonly m_app: express.Application;
private m_assetPath: StaticAssetPath = StaticAssetPath.TRANSPILED;
private m_expressStaticMiddleware: ReturnType<typeof expressStaticGzip>|undefined = undefined;
private m_expressStaticMiddleware?: ReturnType<typeof expressStaticGzip> = undefined;
private static readonly s_htmlExtension = ".html";
private static readonly s_urlDevWebserver = "http://localhost:8080";
/* tslint:disable:no-string-literal */
private static readonly s_useDevWebserver = process.env["USE_DEV_WEBSERVER"] === "true";
/* tslint:enable:no-string-literal */
// Regex must be either simple or constructed using a library that provides DOS protection.
private static readonly s_regexLandingPages = Server.getLandingPagesRegex();
private static readonly s_regexArtifacts = Server.getClientBuildArtifactsRegex();
private static readonly s_expressStaticConfig: expressStaticGzip.ExpressStaticGzipOptions = {
Expand Down
3 changes: 2 additions & 1 deletion server/tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"member-ordering": false,
"member-access": false,
"max-classes-per-file": [true, 3, "exclude-class-expressions"],
"interface-over-type-literal": false
"interface-over-type-literal": false,
"no-var-requires": false
},
"rulesDirectory": []
}
91 changes: 46 additions & 45 deletions server/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,13 @@
dependencies:
"@types/node" "*"

"@types/http-proxy@^1.17.3":
version "1.17.3"
resolved "https://registry.yarnpkg.com/@types/http-proxy/-/http-proxy-1.17.3.tgz#348e1b808ff9585423cb909e9992d89ccdbf4c14"
integrity sha512-wIPqXANye5BbORbuh74exbwNzj+UWCwWyeEFJzUQ7Fq3W2NSAy+7x7nX1fgbEypr2/TdKqpeuxLnXWgzN533/Q==
dependencies:
"@types/node" "*"

"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1":
version "2.0.1"
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff"
Expand All @@ -581,10 +588,10 @@
"@types/istanbul-lib-coverage" "*"
"@types/istanbul-lib-report" "*"

"@types/[email protected].2":
version "25.1.2"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-25.1.2.tgz#1c4c8770c27906c7d8def5d2033df9dbd39f60da"
integrity sha512-EsPIgEsonlXmYV7GzUqcvORsSS9Gqxw/OvkGwHfAdpjduNRxMlhsav0O5Kb0zijc/eXSO/uW6SJt9nwull8AUQ==
"@types/[email protected].3":
version "25.1.3"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-25.1.3.tgz#9b0b5addebccfb631175870be8ba62182f1bc35a"
integrity sha512-jqargqzyJWgWAJCXX96LBGR/Ei7wQcZBvRv0PLEu9ZByMfcs23keUJrKv9FMR6YZf9YCbfqDqgmY+JUBsnqhrg==
dependencies:
jest-diff "^25.1.0"
pretty-format "^25.1.0"
Expand Down Expand Up @@ -613,10 +620,10 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.7.2.tgz#c4e63af5e8823ce9cc3f0b34f7b998c2171f0c44"
integrity sha512-dyYO+f6ihZEtNPDcWNR1fkoTDf3zAK3lAABDze3mz6POyIercH0lEUawUFXlG8xaQZmm1yEBON/4TsYv/laDYg==

"@types/[email protected].1":
version "13.7.1"
resolved "https://registry.yarnpkg.com/@types/node/-/node-13.7.1.tgz#238eb34a66431b71d2aaddeaa7db166f25971a0d"
integrity sha512-Zq8gcQGmn4txQEJeiXo/KiLpon8TzAl0kmKH4zdWctPj05nWwp1ClMdAVEloqrQKfaC48PNLdgN/aVaLqUrluA==
"@types/[email protected].4":
version "13.7.4"
resolved "https://registry.yarnpkg.com/@types/node/-/node-13.7.4.tgz#76c3cb3a12909510f52e5dc04a6298cdf9504ffd"
integrity sha512-oVeL12C6gQS/GAExndigSaLxTrKpQPxewx9bOcwfvJiJge4rr7wNaph4J+ns5hrmIV2as5qxqN8YKthn9qh0jw==

"@types/range-parser@*":
version "1.2.3"
Expand Down Expand Up @@ -1053,11 +1060,6 @@ camelcase@^2.0.0:
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f"
integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=

camelcase@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd"
integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=

camelcase@^5.0.0, camelcase@^5.3.1:
version "5.3.1"
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320"
Expand Down Expand Up @@ -1624,10 +1626,10 @@ etag@~1.8.1:
resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887"
integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=

eventemitter3@^3.0.0:
version "3.1.2"
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.2.tgz#2d3d48f9c346698fce83a85d7d664e98535df6e7"
integrity sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==
eventemitter3@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.0.tgz#d65176163887ee59f386d64c82610b696a4a74eb"
integrity sha512-qerSRB0p+UDEssxTtm6EDKcE7W4OaoisfIMl4CngyEhjpYglocpNg6UEqCvemdGhosAsg4sO2dXJOdyBifPGCg==

exec-sh@^0.3.2:
version "0.3.2"
Expand Down Expand Up @@ -2195,22 +2197,23 @@ http-errors@~1.7.2:
statuses ">= 1.5.0 < 2"
toidentifier "1.0.0"

http-proxy-middleware@^0.20.0:
version "0.20.0"
resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-0.20.0.tgz#5b128f7207985c4ea91b53fab8ad897a48c690d6"
integrity sha512-dNJAk71nEJhPiAczQH9hGvE/MT9kEs+zn2Dh+Hi94PGZe1GluQirC7mw5rdREUtWx6qGS1Gu0bZd4qEAg+REgw==
http-proxy-middleware@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-1.0.0.tgz#984bbbb38cda7ce4495889388afe8b0f39ccd5c8"
integrity sha512-1yM4gD7R/U9R5AwA6STkoj8JfjnMeZIUrd8e23Yc14A7xVVLUWlAikgvidklwq1UOroJ07sc6NWNULeOJMYOeQ==
dependencies:
http-proxy "^1.17.0"
"@types/http-proxy" "^1.17.3"
http-proxy "^1.18.0"
is-glob "^4.0.1"
lodash "^4.17.14"
lodash "^4.17.15"
micromatch "^4.0.2"

http-proxy@^1.17.0:
version "1.17.0"
resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.17.0.tgz#7ad38494658f84605e2f6db4436df410f4e5be9a"
integrity sha512-Taqn+3nNvYRfJ3bGvKfBSRwy1v6eePlm3oc/aWVxZp57DQr5Eq3xhKJi7Z4hZpS8PC3H4qI+Yly5EmFacGuA/g==
http-proxy@^1.18.0:
version "1.18.0"
resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.18.0.tgz#dbe55f63e75a347db7f3d99974f2692a314a6a3a"
integrity sha512-84I2iJM/n1d4Hdgc6y2+qY5mDaz2PUVjlg9znE9byl+q0uC3DeByqBGReQu5tpLK0TAqTIXScRUV+dg7+bUPpQ==
dependencies:
eventemitter3 "^3.0.0"
eventemitter3 "^4.0.0"
follow-redirects "^1.0.0"
requires-port "^1.0.0"

Expand Down Expand Up @@ -4553,10 +4556,10 @@ triple-beam@^1.2.0, triple-beam@^1.3.0:
resolved "https://registry.yarnpkg.com/triple-beam/-/triple-beam-1.3.0.tgz#a595214c7298db8339eeeee083e4d10bd8cb8dd9"
integrity sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==

[email protected].0:
version "25.2.0"
resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-25.2.0.tgz#dfd87c2b71ef4867f5a0a44f40cb9c67e02991ac"
integrity sha512-VaRdb0da46eorLfuHEFf0G3d+jeREcV+Wb/SvW71S4y9Oe8SHWU+m1WY/3RaMknrBsnvmVH0/rRjT8dkgeffNQ==
[email protected].1:
version "25.2.1"
resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-25.2.1.tgz#49bf05da26a8b7fbfbc36b4ae2fcdc2fef35c85d"
integrity sha512-TnntkEEjuXq/Gxpw7xToarmHbAafgCaAzOpnajnFC6jI7oo1trMzAHA04eWpc3MhV6+yvhE8uUBAmN+teRJh0A==
dependencies:
bs-logger "0.x"
buffer-from "1.x"
Expand All @@ -4567,9 +4570,14 @@ [email protected]:
mkdirp "0.x"
resolve "1.x"
semver "^5.5"
yargs-parser "10.x"
yargs-parser "^16.1.0"

[email protected], tslib@^1.10.0, tslib@^1.8.1:
[email protected]:
version "1.11.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.0.tgz#f1f3528301621a53220d58373ae510ff747a66bc"
integrity sha512-BmndXUtiTn/VDDrJzQE7Mm22Ix3PxgLltW9bSNLoeCY31gnG2OPx0QqJnuc9oMIKioYrz487i6K9o4Pdn0j+Kg==

tslib@^1.10.0, tslib@^1.8.1:
version "1.10.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a"
integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==
Expand Down Expand Up @@ -4644,10 +4652,10 @@ typedarray-to-buffer@^3.1.5:
dependencies:
is-typedarray "^1.0.0"

typescript@3.7.5:
version "3.7.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.5.tgz#0692e21f65fd4108b9330238aac11dd2e177a1ae"
integrity sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw==
typescript@3.8.2:
version "3.8.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.2.tgz#91d6868aaead7da74f493c553aeff76c0c0b1d5a"
integrity sha512-EgOVgL/4xfVrCMbhYKUQTdF37SQn4Iw73H5BgCrF1Abdun7Kwy/QZsE/ssAy0y4LxBbvua3PIbFsbRczWWnDdQ==

unescape-js@^1.0.3:
version "1.1.1"
Expand Down Expand Up @@ -4909,13 +4917,6 @@ y18n@^4.0.0:
resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b"
integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==

[email protected]:
version "10.1.0"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-10.1.0.tgz#7202265b89f7e9e9f2e5765e0fe735a905edbaa8"
integrity sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==
dependencies:
camelcase "^4.1.0"

yargs-parser@^13.1.1:
version "13.1.1"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.1.tgz#d26058532aa06d365fe091f6a1fc06b2f7e5eca0"
Expand Down

0 comments on commit d6a47f8

Please sign in to comment.