{"_id":"easy-routes","_rev":"28-81589a41d6a54004244c69046db03751","name":"easy-routes","description":"cakePHP inspired router for connect/express","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"easy-routes","description":"cakePHP inspired router for connect/express","version":"0.0.1","author":{"name":"Fernando Lores","email":"ferlores@gmail.com"},"keywords":["framework","sinatra","web","rest","restful","cakephp","route","middleware","connect","express"],"repository":{"type":"git","url":"git://github.com/ferlores/easy-routes.git"},"main":"./lib/index","_npmUser":{"name":"ferlores","email":"ferlores@gmail.com"},"_id":"easy-routes@0.0.1","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.4","_nodeVersion":"v0.6.14","_defaultsLoaded":true,"dist":{"shasum":"2ef594be2bb4b232717815a95ad72d0c892a3222","tarball":"https://registry.npmjs.org/easy-routes/-/easy-routes-0.0.1.tgz","integrity":"sha512-yvFfgsDvHEfPa/cEFlQrlZi+phSW0jncsUj1rZZeN+BUYodwCms4qamJNf4cycOL8fuK0Xbim/y5V8GTf0GYSQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBk4YMfIlP7CHtSmGI3A//Abe8YE+52+TdP0QuAmsEk8AiEA79+0FIojxx52B0zvay4Y0aEvG4a0xIxnydpxZuhyPNM="}]},"maintainers":[{"name":"ferlores","email":"ferlores@gmail.com"}]}},"readme":"\n# Easy Routes\n  Extreamly light middleware that creates some default routes for structuring responses inside controllers like cakePHP. Works with [Connect](http://github.com/senchalabs/connect) and [Express](http://github.com/visionmedia/express) \n  \n     var app = http.createServer()\n       , prefixes = ['admin'];\n\t     \n     app.configure(function(){\n\t  app.use(require('easy-routes')(__dirname + '/controllers', prefixes));  \n\t });\n     \n     app.listen(3000);\n\n## Features\n  * Creates default routes for `/<prefix>/<controller>/<action>/<params>`\n  * Looks up the controller/action in the directory passed by param \n  * Controllers are loaded on demand and only once.\n\nIn the handler: \n  \n\treq.param = {\n\t\tprefix: ...,       //optional\n\t\tcontroller: ...,\n\t\taction: ...,\n\t\tparams: [...]      //optional\n\t}\n\t\n## Installation\n\n    $ npm install easy-routes\n\n## Controllers example\n\t\n\tmodule.exports = {\n\t\tindex_GET: function(req, res) {\n\t\t\t/* handle the request */\n\t\t},\n\t\tadmin_index_GET: function(req,res){\n\t\t\t/* handle the request */\t\n\t\t},\n\t\taction_POST: function(req,res){\n\t\t\t/* handle the request */\t\n\t\t},\n\t\t<prefix>_action_<method>: function(req, res){\n\t\t\t/* handle the request */\n\t\t}\n\t}\n\t\n## Quick start\n  * Install easy-routes (npm install easy-routes)\n  * Creates a controllers folder\n  * Add the easy-routes middleware\n  * Creates a controller inside the folder (see controlles example)\n  * Visit http://localhost:3000/controller/action\n\t\n## Running Tests\n\n    $ cd ./testing \n    $ npm install -d\n    $ node app.js\n\nTest suites are in ./testing/tests.js\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2012 Fenando Lores &lt;ferlores@gmail.com&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","maintainers":[{"name":"ferlores","email":"ferlores@gmail.com"}],"time":{"modified":"2022-06-16T03:50:56.146Z","created":"2012-04-09T00:09:05.191Z","0.0.1":"2012-04-09T00:09:08.848Z"},"author":{"name":"Fernando Lores","email":"ferlores@gmail.com"},"repository":{"type":"git","url":"git://github.com/ferlores/easy-routes.git"},"users":{"fflores":true}}