How it works

Once you’ve installed OvernightJS, simply import the controller decorator, place it right before a TypeScript class, and pass it a route (as a string). This string will be prepended to all method routes in your controller. You may add routes to the controller by using decorators for Express GET, POST, PUT, and DELETE routes. Your method will work exactly the same as if it were placed inside of an Express route callback method. The decorators support ExpressJS middleware as well. Any middleware you’d normally pass as the second argument to an express route, simply pass it as the second argument to the decorator.

So instead of doing this…

You can do this :)

Once you start amassing large numbers of controllers and methods, this will save you a lot of code. What do you say we get started?