hop of those help? There is a problem exporting basic logic from a API controller in express.js. Below is the code before (working) and then with the logic exported into an external function (not working). , Just pass the results to the function ?
To fix this issue req and res are just ordinary objects passed as arguments to the controller function. You don't have to require anything special in Parent.controller.js. Just make sure the parameters for createChild are req, res. And next if you needed. Like so:
this will help Your third option you listed may be the best way to do this. You can use the Openness API that is a .net dll. You can quite easily export a plc block (in xml) then import the function block into another project. you don't even have to look at the xml to do this. Here is an example code of how to do so
this one helps. In your .js file, you can export whatever functions you would like to use in other parts of your code base. The below is an example of what should go at the bottom of your .js file. It will export the 3 functions you defined.