expresso-macchiato 0.4.5-dev.2 → 0.4.5-dev.3
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/dist/index.js +8 -7
- package/dist/index.mjs +8 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -666,15 +666,16 @@ var RouterWrapper = class {
|
|
|
666
666
|
const handlerRes = await currentMethod.handler(req, res);
|
|
667
667
|
console.log(`Handling res on [${method}] ${this.data.basePath}${path3}`, JSON.stringify(handlerRes));
|
|
668
668
|
if (handlerRes.contentType) {
|
|
669
|
-
console.log(`[${method}] ${this.data.basePath}${path3} CONTENTTYPE`);
|
|
670
669
|
res.set("Content-Type", handlerRes.contentType);
|
|
671
670
|
res.status(_nullishCoalesce(handlerRes.status, () => ( 200))).send(handlerRes.result);
|
|
672
|
-
} else if (typeof handlerRes.result === "object")
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
671
|
+
} else if (typeof handlerRes.result === "object") res.status(_nullishCoalesce(handlerRes.status, () => ( 200))).json(handlerRes.result);
|
|
672
|
+
else {
|
|
673
|
+
try {
|
|
674
|
+
console.log("sending status " + handlerRes.status + " result " + handlerRes.result);
|
|
675
|
+
res.status(_nullishCoalesce(handlerRes.status, () => ( 200))).send(handlerRes.result);
|
|
676
|
+
} catch (e) {
|
|
677
|
+
console.log("Not managing numbers???");
|
|
678
|
+
}
|
|
678
679
|
}
|
|
679
680
|
} catch (err) {
|
|
680
681
|
fullLogNok("api", `[${method}] ${this.data.basePath}${path3} => ${_nullishCoalesce(err.message, () => ( err))}`);
|
package/dist/index.mjs
CHANGED
|
@@ -666,15 +666,16 @@ var RouterWrapper = class {
|
|
|
666
666
|
const handlerRes = await currentMethod.handler(req, res);
|
|
667
667
|
console.log(`Handling res on [${method}] ${this.data.basePath}${path3}`, JSON.stringify(handlerRes));
|
|
668
668
|
if (handlerRes.contentType) {
|
|
669
|
-
console.log(`[${method}] ${this.data.basePath}${path3} CONTENTTYPE`);
|
|
670
669
|
res.set("Content-Type", handlerRes.contentType);
|
|
671
670
|
res.status(handlerRes.status ?? 200).send(handlerRes.result);
|
|
672
|
-
} else if (typeof handlerRes.result === "object")
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
671
|
+
} else if (typeof handlerRes.result === "object") res.status(handlerRes.status ?? 200).json(handlerRes.result);
|
|
672
|
+
else {
|
|
673
|
+
try {
|
|
674
|
+
console.log("sending status " + handlerRes.status + " result " + handlerRes.result);
|
|
675
|
+
res.status(handlerRes.status ?? 200).send(handlerRes.result);
|
|
676
|
+
} catch {
|
|
677
|
+
console.log("Not managing numbers???");
|
|
678
|
+
}
|
|
678
679
|
}
|
|
679
680
|
} catch (err) {
|
|
680
681
|
fullLogNok("api", `[${method}] ${this.data.basePath}${path3} => ${err.message ?? err}`);
|