ti2 1.0.53 → 1.0.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +3 -2
- package/package.json +2 -1
package/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const express = require('express');
|
|
2
|
+
const compression = require('compression');
|
|
2
3
|
const createMiddleware = require('swagger-express-middleware');
|
|
3
4
|
const { connector } = require('swagger-routes-express');
|
|
4
5
|
const swaggerUi = require('swagger-ui-express');
|
|
@@ -140,6 +141,7 @@ module.exports = async ({
|
|
|
140
141
|
middleware.parseRequest(),
|
|
141
142
|
// middleware.validateRequest(),
|
|
142
143
|
);
|
|
144
|
+
app.use(compression());
|
|
143
145
|
const connect = connector(api, allSchema, {
|
|
144
146
|
security: auth,
|
|
145
147
|
notFound: (req, res) => res.sendStatus(404),
|
|
@@ -235,12 +237,11 @@ module.exports = async ({
|
|
|
235
237
|
if (process.env.CONSOLE_ERRORS || process.env.JEST_WORKER_ID) {
|
|
236
238
|
console.error(R.path(['response', 'data'], err), err);
|
|
237
239
|
}
|
|
238
|
-
console.log('hit hre');
|
|
239
240
|
return res.status((() => {
|
|
240
241
|
if (!isNumber(err.status)) return 500;
|
|
241
242
|
return Number(err.status);
|
|
242
243
|
})()).send({
|
|
243
|
-
message: R.path(['response', 'data', 'errorMessage'], err) || err.message || 'Internal Error',
|
|
244
|
+
message: typeof err === 'string' ? err : (R.path(['response', 'data', 'errorMessage'], err) || err.message || 'Internal Error'),
|
|
244
245
|
});
|
|
245
246
|
});
|
|
246
247
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ti2",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.55",
|
|
4
4
|
"description": "Tourist Industry Exchange (TI2)",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"bluebird": "^3.7.2",
|
|
29
29
|
"bull": "^4.8.2",
|
|
30
30
|
"commander": "^9.2.0",
|
|
31
|
+
"compression": "^1.7.4",
|
|
31
32
|
"eventemitter2": "^6.4.9",
|
|
32
33
|
"express": "^4.17.2",
|
|
33
34
|
"ioredis": "^5.0.4",
|