Koa2 + TypeScript + IOC = Koatty. Koatty is a progressive Node.js framework for building efficient and scalable server-side applications. It's perfect for crafting enterprise-level APIs, microservices, and full-stack applications with TypeScript excellence.
@ExceptionHandler()
for global exception handling βοΈ// config/config.ts export default { ... protocol: "grpc", // Server protocol 'http' | 'https' | 'http2' | 'grpc' | 'ws' | 'wss' | 'graphql' ... }
@Service() export class UserService { async findUser(id: number) { return { id, name: 'Koatty User' }; } } @Controller() export class IndexController { app: App; ctx: KoattyContext; @Config("protocol") conf: { protocol: string }; ... @Autowired() private userService: UserService; async test(id: number) { const info = await this.userService.findUser(id); ... } }βοΈ Aspect-Oriented Programming
@Aspect() export class LogAspect implements IAspect { app: App; run() { console.log('LogAspect'); } } // Apply aspect to controller @Controller() @BeforeEach(LogAspect) export class UserController { ... @After(LogAspect) test() { ... } }
// plugin/logger.ts export class LoggerPlugin implements IPlugin { app: App; run() { // todo something or hook on app.event Logger.Debug("LoggerPlugin"); return Promise.resolve(); } }Framework Requests/sec Latency Memory Usage Koatty 13,321 1.43ms 54MB Express 12,456 1.45ms 52MB NestJS 11,892 1.51ms 63MB
Tested on AWS t3.micro with 100 concurrent connections
npm install -g koatty_cli
cd awesome-app npm run dev
Thanks to these amazing developers:
BSD-3 Β© Koatty Team
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4