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