@webtypen/webframez-core 0.0.45 → 0.0.47

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.
@@ -4,7 +4,7 @@ export declare class LambdaApplication {
4
4
  */
5
5
  boot(event: any, context: any, options?: any): Promise<void | {
6
6
  statusCode: number;
7
- body: string;
7
+ body: any;
8
8
  headers: {
9
9
  [key: string]: string;
10
10
  };
@@ -108,7 +108,7 @@ declare class RouterFacade {
108
108
  */
109
109
  handleRequest(req: null | IncomingMessage, res: null | ServerResponse, options?: any): Promise<void | {
110
110
  statusCode: number;
111
- body: string;
111
+ body: any;
112
112
  headers: {
113
113
  [key: string]: string;
114
114
  };
@@ -226,7 +226,7 @@ class RouterFacade {
226
226
  if (req && req.url && req.url.indexOf("?") > 0) {
227
227
  const temp = req.url.substring(req.url.indexOf("?") + 1);
228
228
  if (temp && temp.trim() !== "") {
229
- const entries = temp.split("=");
229
+ const entries = temp.split("&");
230
230
  for (let entry of entries) {
231
231
  if (entry.indexOf("=") > 0) {
232
232
  urlParams[entry.substring(0, entry.indexOf("="))] = entry.substring(entry.indexOf("=") + 1);
@@ -398,7 +398,7 @@ class RouterFacade {
398
398
  if (this.mode === "aws-lambda") {
399
399
  return {
400
400
  statusCode: response.statusCode,
401
- body: JSON.stringify(response.content),
401
+ body: typeof response.content === "object" ? JSON.stringify(response.content) : response.content,
402
402
  headers: response.headers,
403
403
  };
404
404
  }
@@ -414,6 +414,7 @@ class RouterFacade {
414
414
  body: JSON.stringify({
415
415
  status: "error",
416
416
  message: "Error running the component ...",
417
+ error: e.toString(),
417
418
  }),
418
419
  headers: response.headers,
419
420
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webtypen/webframez-core",
3
- "version": "0.0.45",
3
+ "version": "0.0.47",
4
4
  "description": "The core package of the typescript based webframez (web-framework) by webtypen.de",
5
5
  "homepage": "https://webtypen.de/",
6
6
  "license": "MIT",
@@ -270,7 +270,7 @@ class RouterFacade {
270
270
  if (req && req.url && req.url.indexOf("?") > 0) {
271
271
  const temp = req.url.substring(req.url.indexOf("?") + 1);
272
272
  if (temp && temp.trim() !== "") {
273
- const entries = temp.split("=");
273
+ const entries = temp.split("&");
274
274
  for (let entry of entries) {
275
275
  if (entry.indexOf("=") > 0) {
276
276
  urlParams[entry.substring(0, entry.indexOf("="))] = entry.substring(
@@ -472,20 +472,21 @@ class RouterFacade {
472
472
  if (this.mode === "aws-lambda") {
473
473
  return {
474
474
  statusCode: response.statusCode,
475
- body: JSON.stringify(response.content),
475
+ body: typeof response.content === "object" ? JSON.stringify(response.content) : response.content,
476
476
  headers: response.headers,
477
477
  };
478
478
  } else if (res && req) {
479
479
  res.end();
480
480
  this.requestConsoleLog(req, response.statusCode);
481
481
  }
482
- } catch (e) {
482
+ } catch (e: any) {
483
483
  if (this.mode === "aws-lambda") {
484
484
  return {
485
485
  statusCode: 500,
486
486
  body: JSON.stringify({
487
487
  status: "error",
488
488
  message: "Error running the component ...",
489
+ error: e.toString(),
489
490
  }),
490
491
  headers: response.headers,
491
492
  };