Routing

Enso uses koa under the hood. Callbacks are 💀.

Instead of having to declare a routes file. We can leverage decorators to elegantly annotate our Controllers with their respective paths and HTTP verbs.

This funcitionaly is provided through the inversify-koa package.

Below is a list of commonly used decorators.

Note

This package is quite dated but does the job for now. Eventually we plan to port the libary as a core package @ensojs/inversify-koa

Next

  • Learn how to to use various types of Middleware in your service.