UNPKG

@nova-ts/core

Version:

A serverside framework used to build scalable application

33 lines (30 loc) 1.27 kB
import express from 'express'; /** * @class NovaRouteBinder * @description * Responsible for binding all registered controllers and their routes to the Express application. * It centralizes the process of reading controller metadata, applying filters, * and setting up the routing logic using `NovaControllerInvoker` and `NovaFilterExecutor`. * * This class acts as the final integrator that brings together the components of the Nova * HTTP pipeline — controllers, filters, argument resolvers — and registers them with Express. */ declare class NovaRouteBinder { private app; private resolver; constructor(app: express.Express); /** * Binds all controllers from the `ControllerRegistry` to the Express app. * * This method: * - Retrieves controller classes and metadata. * - Resolves controller instances from `ApplicationContext`. * - Constructs the full route path. * - Sets up a `NovaFilterExecutor` and `NovaControllerInvoker` for each route. * - Registers the route handler with Express using the appropriate HTTP method. * * This is the main entry point for bootstrapping route registration in the Nova framework. */ bindAllControllers(): void; } export { NovaRouteBinder };