@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.
- package/dist/router.js +2 -0
- 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