0.0.2 • Published 8 years ago

express-get-routes v0.0.2

Weekly downloads
6
License
GPLv3
Repository
github
Last release
8 years ago

express-get-routes

Extracts Route information out of an express application or router. The format of the routes is the following:

interface Route {
  path : string;
  methods : {
    get? : boolean;
    post? : boolean;
    put? : boolean;
    delete? : boolean;
  }
}

Usage

import * as express from 'express';
import {getRoutes} from 'express-get-routes';

let app = express();
// ... setup app

// contains an array of routes
let routes = getRoutes(app);

// print every route to the console
routes.forEach((route) => {
  console.log(route.path);
})