With ModularBr, the routes of your API can be defined in a clear and organized manner using the Route Handlers feature. With this feature, you can divide the implementations into separate classes that inherit from the TRouteHandler class, where each class is responsible for defining the corresponding routes and their handlers. Then, the list of classes that define the routes is registered in a single place - the RouteHandlers method of the AppModule module - making development and maintenance easier and more efficient.
By using Route Handlers, the code becomes more modular and easier to understand, allowing you to quickly find the implementations for each route. This means that you can have a more organized structure for handling the routes of your application, making maintenance and the addition of new features easier. With ModularBr, you have a powerful feature that helps make your API more efficient, organized, and easy to manage.
procedureTFormServer.StartRoutes;begin ReportMemoryLeaksOnShutdown := True;// Registering to AppModule/Route Guardian THorse.Use(HorseModular(TAppModule.Create));// Putting the server online. StartServer;end;procedureTFormServer.StartServer;begin THorse.Listen(9000);end;