play-routes-to-json
v0.1.0
Published
Convert your play routes to a nicer json format
Downloads
4
Readme
play-routes-to-json
Convert your play routes file to a nicer json format
See play-routes-from-json to generate a routes file from your new JSON format.
Install
$ npm install --save play-routes-to-json
Usage
var routesToJSON = require('play-routes-to-json');
var fs = require('fs');
fs.readFile('conf/routes', function(err, data) {
var parsed = routesToJSON(data);
console.log(JSON.parse(parsed).routes);
//=> { type: 'GET', path: '/path/to/action', controller: '@controllers.handleAction()' }
});
License
MIT © Charlie Dowler