@increase21/simplenodejs 1.0.9 → 1.0.10

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.
Files changed (2) hide show
  1. package/dist/router.js +2 -0
  2. package/package.json +1 -1
package/dist/router.js CHANGED
@@ -55,6 +55,8 @@ async function route(req, res, controllersDir) {
55
55
  return res.status(404).json({ error: "The requested resource does not exist" });
56
56
  const ControllerClass = meta.Controller;
57
57
  const controller = new ControllerClass();
58
+ //Update the method name to the framework pathen
59
+ methodName = (methodName || "").replace(/\-{1}\w{1}/g, match => match.replace("-", "").toUpperCase());
58
60
  //if the endpoint not a function
59
61
  if (typeof controller[methodName] !== "function") {
60
62
  //if it's using index
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@increase21/simplenodejs",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "Lightweight Node.js HTTP framework with middleware and plugins",
5
5
  "dev": "dist/index.js",
6
6
  "bugs": "https://github.com/increase21/simplenodejs/issues",