Simple as express, powerful as Chuka!

Simple as express, powerful as Chuka!

Hello everyone!

I am going to introduce you to Chuka, a new library which tends to make the backend development easier and keep the code maintainable. It is built on top of ExpressJS, so simple to learn though able to tackle technical challenges through simple and reasonable approaches.

In brief, it has three main advantages, dependency injection, strongly typed with typescript, and powerful validation. Additionally, a fast learning curve with whom they are familiar with express-like libraries.

I introduce it by applying the library for a simple list-of-cats program.

app.ts

The first snippet features how we can introduce both dependencies and routes together and gives an overview of the running application to the programmer.

cats.controller.ts

The second snippet depicts the use of applying middlewares, using dependencies and creating a completely custom validation mechanism.

Applying the Validators and Middlewares will cause the handlers to be helped with strong types.

strong types

In the above picture, the body has intellisense because the body of the request object was validated with a middleware before!

Even more!

You can validate anything that is being passed through the request, such as session, cookies, query, etc.

DI

You have dependency injection and it helps your controllers access the outside world through loosely coupled dependencies which gives you the ability to test your application easily and evade being dependent upon implementation details.

At last...

It is just a try to make the application development easier for our community! let's make it better and please let me know your ideas and suggestions of how it will be a better tool for our benefit.

https://github.com/hgaleh/chuka

Farzad Jamshidi

Senior Angular Developer | React.js | Nest.js | .Net Core | Blazor | Blockchain Smart Contract

1 年

Good, try nest.js also.

回复

要查看或添加评论,请登录

Hojjat B.的更多文章

  • Decorators paralyse Classes and Functions

    Decorators paralyse Classes and Functions

    Decorators are frequently used in major frameworks like Angular, Spring Boot, NestJS. However there are a lot of…

  • ?? ???? ?? ?????? ?????

    ?? ???? ?? ?????? ?????

    ????? ????? ???? ?????? ?? ??? ??? ?? ?????? ???? ?? ????: "??? ??? ??? ???..

社区洞察

其他会员也浏览了