compound
compound copied to clipboard
Question: migrate from compound to pure ExpressJS
I want to remove compound from application due multiple issue with evaluation of controllers that seems isn't removable. I suppose compound internally pass req, res
from ExpressJs to any action
handler. Just one question remained - where is declaration of action
so I able to import it to specific controller file to avoid breaking production code?
You can use non-evaluated code to write your controllers, it is not recommended to use eval-style.
Here's where action
defined: https://github.com/1602/kontroller/blob/master/lib/flow-control.js#L209
@1602 thanks for response. Unfortunately it doesn't looks working (or I don't understand how to use it). action
definition declared in kontroller
but I cannot find how to import it into my controller after renaming it from some_controller.js
to some.js
(as I remember postfix _controller
makes it evaluateable).
if you rename some_controller.js
to some.js
it should indeed turn off eval mode and you will need to rewrite your controller to not use actionName(...
, and use ControllerName.prototype.actionName = (c) => {}
instead.
There's no need to use kontroller
package directly, I only referred to it to answer to your question.