The default router plugin for gengo.js.
An example usage with options is:
var gengo = require('gengojs');
var router = require('gengojs-default-router');
/* In whatever framework you are using: */
// I'll use express for an example
// but it shouldn't matter
var app = require('express')();
app.use(gengo({
// Specify the type
// of option to modify
router:{
/* options */
}
},/*router()*/));
{
"enabled":false
}
this.router.toArray()
- Should return the URL path as an array.
this.router.toDot()
- Should return the URL path as an dotted string.
this.router.isEnabled()
- Should return true if router is enabled.
Not Applicable
Unix:
DEBUG=gengo.router
Windows:
SET DEBUG=gengo.router
See gengojs-debug for usage.
Feel free to contribute or even fork the project. This plugin has been written in ES6 and can be seen under lib/index.js.