lieko-express 1.0.21 → 1.0.22
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/lieko-express.js +11 -4
- package/package.json +1 -1
package/lieko-express.js
CHANGED
|
@@ -449,6 +449,17 @@ class LiekoExpress {
|
|
|
449
449
|
all(path, ...handlers) { return this._call('all', path, handlers); },
|
|
450
450
|
|
|
451
451
|
use(pathOrMw, ...rest) {
|
|
452
|
+
|
|
453
|
+
if (Array.isArray(pathOrMw)) {
|
|
454
|
+
pathOrMw.forEach(p => {
|
|
455
|
+
if (typeof p !== 'string') {
|
|
456
|
+
throw new Error('group.use() array must contain only strings');
|
|
457
|
+
}
|
|
458
|
+
this.use(p, ...rest);
|
|
459
|
+
});
|
|
460
|
+
return subApp;
|
|
461
|
+
}
|
|
462
|
+
|
|
452
463
|
if (typeof pathOrMw === 'object' && pathOrMw instanceof LiekoExpress) {
|
|
453
464
|
const finalPath = fullBase === '/' ? '/' : fullBase;
|
|
454
465
|
parent.use(finalPath, ...middlewares, pathOrMw);
|
|
@@ -1610,10 +1621,6 @@ ${cyan} (req, res, next) => {
|
|
|
1610
1621
|
return res.status(201).json({ data, message });
|
|
1611
1622
|
};
|
|
1612
1623
|
|
|
1613
|
-
res.notModified = () => {
|
|
1614
|
-
return res.status(304).end();
|
|
1615
|
-
};
|
|
1616
|
-
|
|
1617
1624
|
res.noContent = () => {
|
|
1618
1625
|
return res.status(204).end();
|
|
1619
1626
|
};
|