express-load-routers
Load routers from specific folders for Express 4.x
Install
npm i express-load-routers
Usage
const path = ;const express = ;const loadRouters = ; const app = ; app;
Options
;
option | type | default | decription |
---|---|---|---|
exclude | Array | ['_*'] | This array contain match patterns that will excludes. |
Router
ex) routes/sample.js -> http://localhost/sample/
moduleexports = router = ;router;
ex) routes/camel/index.js -> http://localhost/camel/
ex) routes/one/two.js -> http://localhost/one/two/three/
moduleexports = router = ;router;
License
MIT License.