express-routes-dir

A simple way to use the /routes directory

npm install express-routes-dir
4 downloads in the last week
8 downloads in the last month

Express Routes Dir

In /routes/routes.json:

{
    "routes":{
        "/index" : "get",
        "/update" : "post"
    }
}

/routes:

routes.json
index.js
update.js

In your server:

var dir = require("express-routes-dir");
dir(["routes"],app);
/* optional */ dir(["user-update","user-list"],app,"/user" /* prefix http routes with /user) */ // use multiple directories
npm loves you