@vulkano/core 1.17.3 → 1.17.4
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/bootstrap/express.js +3 -1
- package/bootstrap/server.js +4 -2
- package/package.json +1 -1
package/bootstrap/express.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
|
|
1
3
|
const merge = require('../libs/Merge');
|
|
2
4
|
|
|
3
5
|
module.exports = function getExpressConfiguration() {
|
|
@@ -49,7 +51,7 @@ module.exports = function getExpressConfiguration() {
|
|
|
49
51
|
sockets: {},
|
|
50
52
|
redis: {},
|
|
51
53
|
multer: {
|
|
52
|
-
dest: 'public/files'
|
|
54
|
+
dest: global.PUBLIC_PATH ? path.join(global.PUBLIC_PATH, 'files') : 'public/files'
|
|
53
55
|
},
|
|
54
56
|
morgan: {
|
|
55
57
|
format: 'dev',
|
package/bootstrap/server.js
CHANGED
|
@@ -191,7 +191,8 @@ module.exports = function loadServer() {
|
|
|
191
191
|
|
|
192
192
|
vulkano.use( (req, res, next) => {
|
|
193
193
|
if (req.timedout) {
|
|
194
|
-
|
|
194
|
+
res.status(503).json({ success: false, statusCode: 503, error: { detail: 'Request timeout' } });
|
|
195
|
+
return;
|
|
195
196
|
}
|
|
196
197
|
next();
|
|
197
198
|
});
|
|
@@ -663,7 +664,8 @@ module.exports = function loadServer() {
|
|
|
663
664
|
|
|
664
665
|
// Timeout — always respond with JSON regardless of request type
|
|
665
666
|
if (req.timedout || (err && err.timeout)) {
|
|
666
|
-
|
|
667
|
+
res.status(503).json({ success: false, statusCode: 503, error: { detail: 'Request timeout' } });
|
|
668
|
+
return;
|
|
667
669
|
}
|
|
668
670
|
|
|
669
671
|
const status = err ? (err.status || 500) : (res.statusCode || 500);
|