1 个仓库
Declarative layers for organizing API endpoints and request handling logic within web frameworks.
Distinct from TypeScript: Existing candidates focus on the TypeScript language generally or UI frameworks, not the controller architectural pattern.
Explore 1 awesome GitHub repository matching web development · Web Framework Controllers. Refine with filters or upvote what's useful.
routing-controllers 是一个用于 TypeScript 的声明式 API 路由器和 Web 框架控制器。它提供了一个系统,用于使用基于类的装饰器和元数据定义 HTTP 路由和请求处理逻辑,从而将 API 端点组织成结构化的架构。 该项目利用基于适配器的服务器集成将路由逻辑与底层 Web 框架解耦,为 Express 和 Koa 提供了特定的集成。它具有一个基于反射的类型转换系统,可验证传入的请求参数并将其转换为类型化的类实例。 功能面涵盖了完整的请求-响应管道,包括中间件执行、响应拦截和全局错误管理。它支持高级路由实用程序,如全局路由前缀、基于文件系统的组件发现和依赖注入集成。其他功能包括基于角色的访问控制、已验证用户注入以及用于文件上传和响应流的专门处理程序。
Provides a declarative class-based routing layer for organizing API endpoints using decorators in TypeScript.