This is my first time creating a Node.js backend before I used ASP.NET Core. I would like to use some kind of DI Container and use controllers with it. In ASP.NET Core, an instance of the controller class is created for each request, and I don’t understand if this is required in Node.js or if controllers are better done in the form of singletons that will be located in the DI Container.
export class TestController extends ControllerBase {
construct() {
router.get("/test", function (req, res) {
res.send("Test");
});
}
}