An extreme powerful Express Routing machine

Usage no npm install needed!

<script type="module">
  import expressPowerRouter from '';


Build Status CircleCI


An extreme powerful Express Routing machine

What is it ?

This module adds the async/await to your express app. In addition to promise, you can add endpoint configurations so you can intercept the request and do everything you want.


import express, { Request, Response } from 'express';
import controller, { RestController, GET, POST, BadRequestError, CallableStack, Interceptor, RestInterceptor } from 'express-power-router';

const app = express();

class AddPropertyInterceptor implements Interceptor {
  intercepts(parameters:any):boolean {
    return parameters.addProperty;

  async execute(parameters:any, req:Request, res:Response, stack:CallableStack) {
    const result = await;
    result.anotherResult = 'The result has been changed!';
    return result;

class TestRouter {

  @GET('/', { addProperty: true })
  async get() {
    const result = await someModule.execAsyncCall();
    return result; 

  async customEnd(req:Request, res:Response) {
    res.end('my custom end');

  async throwError() {
    throw new BadRequestError('My error message');

app.use(controller.router); // use plugin the powerRouter to your express app
app.listen(process.env.PORT || 8080);