heroku testing

This commit is contained in:
2019-12-22 19:15:33 +03:00
parent dfe7402fae
commit 2a19fab520
3 changed files with 73 additions and 0 deletions

61
package-lock.json generated
View File

@@ -256,6 +256,25 @@
"@types/koa": "*"
}
},
"@types/koa-send": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/@types/koa-send/-/koa-send-4.1.2.tgz",
"integrity": "sha512-rfqKIv9bFds39Jxvsp8o3YJLnEQVPVriYA14AuO2OY65IHh/4UX4U/iMs5L0wATpcRmm1bbe0BNk23TRwx3VQQ==",
"dev": true,
"requires": {
"@types/koa": "*"
}
},
"@types/koa-static": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/@types/koa-static/-/koa-static-4.0.1.tgz",
"integrity": "sha512-SSpct5fEcAeRkBHa3RiwCIRfDHcD1cZRhwRF///ZfvRt8KhoqRrhK6wpDlYPk/vWHVFE9hPGqh68bhzsHkir4w==",
"dev": true,
"requires": {
"@types/koa": "*",
"@types/koa-send": "*"
}
},
"@types/koa__cors": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@types/koa__cors/-/koa__cors-2.2.3.tgz",
@@ -2717,6 +2736,26 @@
}
}
},
"koa-send": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/koa-send/-/koa-send-5.0.0.tgz",
"integrity": "sha512-90ZotV7t0p3uN9sRwW2D484rAaKIsD8tAVtypw/aBU+ryfV+fR2xrcAwhI8Wl6WRkojLUs/cB9SBSCuIb+IanQ==",
"requires": {
"debug": "^3.1.0",
"http-errors": "^1.6.3",
"mz": "^2.7.0",
"resolve-path": "^1.4.0"
}
},
"koa-static": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/koa-static/-/koa-static-5.0.0.tgz",
"integrity": "sha512-UqyYyH5YEXaJrf9S8E23GoJFQZXkBVJ9zYYMPGz919MSX1KuvAcycIuS0ci150HCoPf4XQVhQ84Qf8xRPWxFaQ==",
"requires": {
"debug": "^3.1.0",
"koa-send": "^5.0.0"
}
},
"koa-unless": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/koa-unless/-/koa-unless-1.0.7.tgz",
@@ -3958,6 +3997,28 @@
"integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
"dev": true
},
"resolve-path": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/resolve-path/-/resolve-path-1.4.0.tgz",
"integrity": "sha1-xL2p9e+y/OZSR4c6s2u02DT+Fvc=",
"requires": {
"http-errors": "~1.6.2",
"path-is-absolute": "1.0.1"
},
"dependencies": {
"http-errors": {
"version": "1.6.3",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz",
"integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=",
"requires": {
"depd": "~1.1.2",
"inherits": "2.0.3",
"setprototypeof": "1.1.0",
"statuses": ">= 1.4.0 < 2"
}
}
}
},
"restore-cursor": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz",

View File

@@ -11,6 +11,7 @@
"@types/koa": "^2.11.0",
"@types/koa-logger": "^3.1.1",
"@types/koa-router": "^7.0.42",
"@types/koa-static": "^4.0.1",
"@types/koa__cors": "^2.2.3",
"@types/lodash": "^4.14.149",
"@types/mocha": "^5.2.7",
@@ -50,13 +51,22 @@
"koa-jwt": "^3.6.0",
"koa-logger": "^3.2.1",
"koa-router": "^7.4.0",
"koa-static": "^5.0.0",
"lodash": "^4.17.15",
"mysql": "^2.17.1",
"reflect-metadata": "^0.1.13",
"typeorm": "0.2.21"
},
"cacheDirectories": [
"frontend/node_modules",
"node_modules"
],
"scripts": {
"ts-node-dev": "ts-node-dev -r tsconfig-paths/register src/server.ts",
"start": "ts-node -T -r tsconfig-paths/register src/server.ts",
"prod-start": "cross-env NODE_ENV=development npm start",
"build-frontend": "cd frontend && npm i && npm run build",
"build": "npm run build-frontend",
"frontend": "cd frontend && npm start",
"dev": "cross-env NODE_ENV=development concurrently npm:ts-node-dev npm:frontend -c 'blue,green'",
"test": "cross-env NODE_ENV=test mocha --timeout 15000 -r ts-node/register -r tsconfig-paths/register 'tests/**/*.ts' "

View File

@@ -5,6 +5,7 @@ import * as Koa from "koa";
import * as bodyParser from "koa-body";
import * as jwt from "koa-jwt";
import * as logger from "koa-logger";
import * as serve from "koa-static";
import { config } from "~config";
import { docsRouter } from "~routes/docs";
import { userRouter } from "~routes/users";
@@ -20,6 +21,7 @@ app.use(
passthrough: true,
}),
);
app.use(serve("frontend/dist"));
app.use(async (ctx, next) => {
try {