expresso-macchiato 0.4.3 → 0.4.4-dev.1

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 CHANGED
@@ -664,11 +664,12 @@ var RouterWrapper = class {
664
664
  const callBackFunction = async (req, res) => {
665
665
  try {
666
666
  const handlerRes = await currentMethod.handler(req, res);
667
+ console.log(`Handling res on [${method}] ${this.data.basePath}${path3}`, JSON.stringify(handlerRes));
667
668
  if (handlerRes.contentType) {
668
669
  res.set("Content-Type", handlerRes.contentType);
669
670
  res.status(_nullishCoalesce(handlerRes.status, () => ( 200))).send(handlerRes.result);
670
- } else if (typeof handlerRes.result === "object") res.status(handlerRes.status).json(handlerRes.result);
671
- else res.status(handlerRes.status).send(handlerRes.result);
671
+ } else if (typeof handlerRes.result === "object") res.status(_nullishCoalesce(handlerRes.status, () => ( 200))).json(handlerRes.result);
672
+ else res.status(_nullishCoalesce(handlerRes.status, () => ( 200))).send(handlerRes.result);
672
673
  } catch (err) {
673
674
  fullLogNok("api", `[${method}] ${this.data.basePath}${path3} => ${_nullishCoalesce(err.message, () => ( err))}`);
674
675
  res.status(500).send(_nullishCoalesce(_optionalChain([err, 'optionalAccess', _41 => _41.message]), () => ( err)));
package/dist/index.mjs CHANGED
@@ -664,11 +664,12 @@ var RouterWrapper = class {
664
664
  const callBackFunction = async (req, res) => {
665
665
  try {
666
666
  const handlerRes = await currentMethod.handler(req, res);
667
+ console.log(`Handling res on [${method}] ${this.data.basePath}${path3}`, JSON.stringify(handlerRes));
667
668
  if (handlerRes.contentType) {
668
669
  res.set("Content-Type", handlerRes.contentType);
669
670
  res.status(handlerRes.status ?? 200).send(handlerRes.result);
670
- } else if (typeof handlerRes.result === "object") res.status(handlerRes.status).json(handlerRes.result);
671
- else res.status(handlerRes.status).send(handlerRes.result);
671
+ } else if (typeof handlerRes.result === "object") res.status(handlerRes.status ?? 200).json(handlerRes.result);
672
+ else res.status(handlerRes.status ?? 200).send(handlerRes.result);
672
673
  } catch (err) {
673
674
  fullLogNok("api", `[${method}] ${this.data.basePath}${path3} => ${err.message ?? err}`);
674
675
  res.status(500).send(err?.message ?? err);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expresso-macchiato",
3
- "version": "0.4.3",
3
+ "version": "0.4.4-dev.1",
4
4
  "author": "Alessio Velluso",
5
5
  "license": "MIT",
6
6
  "description": "Description",