{"repo":"inversify/inversify-express-utils","free":true,"listed":false,"github":"https://github.com/inversify/inversify-express-utils","clone":"git clone https://github.com/inversify/inversify-express-utils.git","description":"Some utilities for the development of Express application with InversifyJS","language":"TypeScript","stars":607,"topics":["inversify","dependency-injection-container","dependency-injection-framework","dependency-injection","inversion-of-control","nodejs","javascript","typescript","express"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"inversify-express-utils [!NOTE] Inversify express utils are deprecated. New http utils are part of the framework included in the monorepo. Documentation pages are avaliable here Some utilities for the development of express applications with Inversify. Installation You can install inversify-express-utils using npm: The inversify-express-utils type definitions are included in the npm module and require TypeScript 2.0. Please refer to the InversifyJS documentation to learn more about the installation process. The Basics Step 1: Decorate your controllers To use a class as a \"controller\" for your express app, simply add the @controller decorator to the class. Similarly, decorate methods of the class to serve as request handlers. The following example will declare a controller that responds to GET /foo'. Step 2: Configure container and server Configure the inversify container in your composition root as usual. Then, pass the container to the InversifyExpressServer constructor. This will allow it to register all controllers and their dependencies from your container and attach them to the express app. Then just call server.build() to prepare your app. In order for the InversifyExpressServer to find your controllers, you must bind them to the TYPE.Controller service identifier and tag the binding with the controller's name. The Controller interface exported by inversify-express-utils is empty and solely for convenience, so feel free to implement your own if you want. Important infor","default_branch":null,"files":null,"tree":[],"storefront":"/r/inversify","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/inversify/inversify-express-utils/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}