{"_id":"road","_rev":"39-5085a82820d832e5891611ad52734b1f","name":"road","description":"A route helper for express.","dist-tags":{"latest":"0.4.0"},"versions":{"0.0.1":{"name":"road","version":"0.0.1","description":"A route helper for express.","homepage":"https://github.com/kishorenc/road","author":{"name":"Kishore Nallan","email":"kishore@kishorelive.com"},"contributors":[{"name":"Kishore Nallan","email":"kishore@kishorelive.com"}],"repository":{"type":"git","url":"git://github.com/kishorenc/road.git"},"bugs":{"email":"kishore@kishorelive.com","url":"https://github.com/kishorenc/road/issues"},"main":"index.js","engines":{"node":">=0.4.0"},"licenses":[{"type":"MIT","url":"https://raw.github.com/kishorenc/road/master/LICENSE"}],"_npmUser":{"name":"kishorenc","email":"kishore@kishorelive.com"},"_id":"road@0.0.1","dependencies":{},"devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"ae0f256a848dfdf9475caabf7f4d21acac31b060","tarball":"https://registry.npmjs.org/road/-/road-0.0.1.tgz","integrity":"sha512-jo1FnlMUXtAdLZdidwa91V81sE8uVKPbqUg1INXyEURGfyDMyEV3sQk8ouC8OgOK5NzSOuqXraNwqlPtS/nRkg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCAoMmS9mtgf9XN1OjD/J8sO73MIzlPPxVon+o8TGJ3awIhAMk/y1n622tCtEl/0HyJz459m+9RJ+b1/EImdYLfvgTn"}]},"maintainers":[{"name":"kishorenc","email":"kishore@kishorelive.com"}]},"0.0.2":{"name":"road","version":"0.0.2","description":"A route helper for express.","homepage":"https://github.com/kishorenc/road","author":{"name":"Kishore Nallan","email":"kishore@kishorelive.com"},"contributors":[{"name":"Kishore Nallan","email":"kishore@kishorelive.com"}],"repository":{"type":"git","url":"git://github.com/kishorenc/road.git"},"bugs":{"email":"kishore@kishorelive.com","url":"https://github.com/kishorenc/road/issues"},"main":"index.js","engines":{"node":">=0.4.0"},"licenses":[{"type":"MIT","url":"https://raw.github.com/kishorenc/road/master/LICENSE"}],"_npmUser":{"name":"kishorenc","email":"kishore@kishorelive.com"},"_id":"road@0.0.2","dependencies":{},"devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"f72a85595b2f352868c78f56f64b22c887911884","tarball":"https://registry.npmjs.org/road/-/road-0.0.2.tgz","integrity":"sha512-W1xmkiEMAqLNodSMDZ2DWBXYPdoF/5OVZJNYefEUAuM8KKCNJHw8bOYZPdKLbhKhSUe2vQH2elcDlwNSmEeECA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQClLy2CRd3sTFpZ7M4CvtKmNikayM8S2eH1BX9mBjzzyAIgccZji3Fkna0ru3ivTYwpxktb7DsWaP4a1q3ApepOvck="}]},"maintainers":[{"name":"kishorenc","email":"kishore@kishorelive.com"}]},"0.0.3":{"name":"road","version":"0.0.3","description":"A route helper for express.","homepage":"https://github.com/kishorenc/road","author":{"name":"Kishore Nallan","email":"kishore@kishorelive.com"},"contributors":[{"name":"Kishore Nallan","email":"kishore@kishorelive.com"}],"repository":{"type":"git","url":"git://github.com/kishorenc/road.git"},"bugs":{"email":"kishore@kishorelive.com","url":"https://github.com/kishorenc/road/issues"},"main":"index.js","engines":{"node":">=0.4.0"},"licenses":[{"type":"MIT","url":"https://raw.github.com/kishorenc/road/master/LICENSE"}],"_npmUser":{"name":"kishorenc","email":"kishore@kishorelive.com"},"_id":"road@0.0.3","dependencies":{},"devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"5d4f0d81c41a8d6726d091392a3c28fd2c7fa805","tarball":"https://registry.npmjs.org/road/-/road-0.0.3.tgz","integrity":"sha512-j/oPhnkWVVeb6GwtosiXprOvZ19IkwLbEmloniov+91MLcRjyfVHcFCZ0bsRDjvZxwocYtuRuUiqVzN/Oot93A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAr2Vn6Vr17WaQP01gXynyFvhyAc3R7KxJhZv7mOQPbCAiEAlzEP5enhkqo1PcRwBKqjU5hMvBwzkL669q01vEovciM="}]},"maintainers":[{"name":"kishorenc","email":"kishore@kishorelive.com"}]},"0.1.2":{"name":"road","version":"0.1.2","description":"A route helper for express.","homepage":"https://github.com/kishorenc/road","author":{"name":"Kishore Nallan","email":"kishore@kishorelive.com"},"contributors":[{"name":"Kishore Nallan","email":"kishore@kishorelive.com"}],"repository":{"type":"git","url":"git://github.com/kishorenc/road.git"},"bugs":{"email":"kishore@kishorelive.com","url":"https://github.com/kishorenc/road/issues"},"main":"index.js","engines":{"node":">=0.4.0"},"licenses":[{"type":"MIT","url":"https://raw.github.com/kishorenc/road/master/LICENSE"}],"_npmUser":{"name":"kishorenc","email":"kishore@kishorelive.com"},"_id":"road@0.1.2","dependencies":{},"devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.4.9","_defaultsLoaded":true,"dist":{"shasum":"3e80dd9f63d33e39dc62ec755a59cb60c47bf9ee","tarball":"https://registry.npmjs.org/road/-/road-0.1.2.tgz","integrity":"sha512-f5B1YmUtxijBrU002EOVyqJBJ/keLm3ngbq5FaiOX0dBPxk/iZmy13WsIZ/ciZsbqpDKWB06kWx8Vk5E9hhgwg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGlwPD6tgFov/seW7fDLdHRaZnF4fmmAOVSwvLtW3h2aAiEA6MztjlEtC+yd+SuZAdgMRfHv7sS72XP+40GiUD617pY="}]},"maintainers":[{"name":"kishorenc","email":"kishore@kishorelive.com"}]},"0.2.0":{"name":"road","version":"0.2.0","description":"A route helper for express.","homepage":"https://github.com/kishorenc/road","author":{"name":"Kishore Nallan","email":"kishore@kishorelive.com"},"contributors":[{"name":"Kishore Nallan","email":"kishore@kishorelive.com"}],"repository":{"type":"git","url":"git://github.com/kishorenc/road.git"},"bugs":{"email":"kishore@kishorelive.com","url":"https://github.com/kishorenc/road/issues"},"main":"index.js","engines":{"node":">=0.4.0"},"licenses":[{"type":"MIT","url":"https://raw.github.com/kishorenc/road/master/LICENSE"}],"_npmUser":{"name":"kishorenc","email":"kishore@kishorelive.com"},"_id":"road@0.2.0","dependencies":{},"devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.4.9","_defaultsLoaded":true,"dist":{"shasum":"1cb3aef338f29742b1247887a309f1b301128821","tarball":"https://registry.npmjs.org/road/-/road-0.2.0.tgz","integrity":"sha512-obTM6VvuVIqC9dEHVG2dBYOIWvLHdJLIVtZyPDJAPp4MQcBwymkYzPLcrsSXlMtIrRuioE0vIORY+Hznock/tQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDgWGRVpeyo0E9jv0gFlbW60afp1Va0hg7BHiZ4FrQ8sAiBRJ/axMc0ntAMgmmjfBPq0fZexm6A5YTwkUhSLWEKntw=="}]},"maintainers":[{"name":"kishorenc","email":"kishore@kishorelive.com"}]},"0.2.1":{"name":"road","version":"0.2.1","description":"A route helper for express.","homepage":"https://github.com/kishorenc/road","author":{"name":"Kishore Nallan","email":"kishore@kishorelive.com"},"contributors":[{"name":"Kishore Nallan","email":"kishore@kishorelive.com"}],"repository":{"type":"git","url":"git://github.com/kishorenc/road.git"},"bugs":{"email":"kishore@kishorelive.com","url":"https://github.com/kishorenc/road/issues"},"main":"index.js","engines":{"node":">=0.4.0"},"licenses":[{"type":"MIT","url":"https://raw.github.com/kishorenc/road/master/LICENSE"}],"_npmUser":{"name":"kishorenc","email":"kishore@kishorelive.com"},"_id":"road@0.2.1","dependencies":{},"devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.4.9","_defaultsLoaded":true,"dist":{"shasum":"342a48c0389a63695e0c772e2a79134b3fea8174","tarball":"https://registry.npmjs.org/road/-/road-0.2.1.tgz","integrity":"sha512-YWgh9SCE0vrsemZGPogfG+Je5AMvHbE6kmrThEw6EzCxf2J2pp3ODrCeVqPJDznBz37IZhapxoWvpwp+EIHK+g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDC1z6H5OGWvpj1liRz+wmoO8FOrIgAlkxKFGH8MNC4IwIgfuWSepO6f1SK7LnmlPDFyv8lI1fVbm6hTl4knMpnH5U="}]},"maintainers":[{"name":"kishorenc","email":"kishore@kishorelive.com"}]},"0.2.2":{"name":"road","version":"0.2.2","description":"A route helper for express.","homepage":"https://github.com/kishorenc/road","author":{"name":"Kishore Nallan","email":"kishore@kishorelive.com"},"contributors":[{"name":"Kishore Nallan","email":"kishore@kishorelive.com"}],"repository":{"type":"git","url":"git://github.com/kishorenc/road.git"},"bugs":{"email":"kishore@kishorelive.com","url":"https://github.com/kishorenc/road/issues"},"main":"index.js","engines":{"node":">=0.4.0"},"licenses":[{"type":"MIT","url":"https://raw.github.com/kishorenc/road/master/LICENSE"}],"_npmUser":{"name":"kishorenc","email":"kishore@kishorelive.com"},"_id":"road@0.2.2","dependencies":{},"devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.4.9","_defaultsLoaded":true,"dist":{"shasum":"5a32d3c306aa0bf13b186c8c93917c9796366d3d","tarball":"https://registry.npmjs.org/road/-/road-0.2.2.tgz","integrity":"sha512-wST7QYsom2rFf7JmVsnd4wryuM0PWpd3dckJuCHgTeHjDzoJTfMQu4NmDJ3eTu0zPeNDzVbRiEdtAgHC07sI5A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDGA8POq4rLLE/t4fROlMbzhaXhp6bd1jozlqtYHM6+GAiEAnY3iXg1XFQmENonzMcSlK86z9cMvLzZMvIsZj0ydsKg="}]},"maintainers":[{"name":"kishorenc","email":"kishore@kishorelive.com"}]},"0.2.3":{"name":"road","version":"0.2.3","description":"A route helper for express.","homepage":"https://github.com/kishorenc/road","author":{"name":"Kishore Nallan","email":"kishore@kishorelive.com"},"contributors":[{"name":"Kishore Nallan","email":"kishore@kishorelive.com"}],"repository":{"type":"git","url":"git://github.com/kishorenc/road.git"},"bugs":{"email":"kishore@kishorelive.com","url":"https://github.com/kishorenc/road/issues"},"main":"index.js","engines":{"node":">=0.4.0"},"licenses":[{"type":"MIT","url":"https://raw.github.com/kishorenc/road/master/LICENSE"}],"_npmUser":{"name":"kishorenc","email":"kishore@kishorelive.com"},"_id":"road@0.2.3","dependencies":{},"devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.4.9","_defaultsLoaded":true,"dist":{"shasum":"ebc678f2ed5979ebfc5908832773b89fb23b737c","tarball":"https://registry.npmjs.org/road/-/road-0.2.3.tgz","integrity":"sha512-3a9tc2DjeWn5N2K7DRaG05j7xoy41I0NAxSTKFBPo3qgpgajbAVNAIgwj+MIMabOuurPZjDwBlThHfHNtw2ZKg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCquMMu4ok8NkVacy7xhS7o+ZS2L9LK9LQqzkecFY/HswIgZxxI0lCgetbWEecL3xVwXX28WhSu8BrgJXoae8xC+fE="}]},"maintainers":[{"name":"kishorenc","email":"kishore@kishorelive.com"}]},"0.2.4":{"name":"road","version":"0.2.4","description":"A route helper for express.","homepage":"https://github.com/kishorenc/road","author":{"name":"Kishore Nallan","email":"kishore@kishorelive.com"},"contributors":[{"name":"Kishore Nallan","email":"kishore@kishorelive.com"}],"repository":{"type":"git","url":"git://github.com/kishorenc/road.git"},"bugs":{"email":"kishore@kishorelive.com","url":"https://github.com/kishorenc/road/issues"},"main":"index.js","engines":{"node":">=0.4.0"},"licenses":[{"type":"MIT","url":"https://raw.github.com/kishorenc/road/master/LICENSE"}],"_npmUser":{"name":"kishorenc","email":"kishore@kishorelive.com"},"_id":"road@0.2.4","dependencies":{},"devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.4.9","_defaultsLoaded":true,"dist":{"shasum":"1021c04c29a090b64531b220e846ce0bb6aa869c","tarball":"https://registry.npmjs.org/road/-/road-0.2.4.tgz","integrity":"sha512-C9d8BgF20HsVeAygJUW/BQ/hD7I0TixT8Pml2XQ5sExrDhLlZ5v5jcTPMHRXwrEBQpLGqkBeJjAak7tAkb6Efg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCT72Kdz130QtHCTPCBgWTOgn5PsXoCNPNEJyyiUiV7UQIhAPSaj4b7Y2qpNxb54srNFzq4SVQDDYCqIBzjvQLJdfiH"}]},"maintainers":[{"name":"kishorenc","email":"kishore@kishorelive.com"}]},"0.2.5":{"name":"road","version":"0.2.5","description":"A route helper for express.","homepage":"https://github.com/kishorenc/road","author":{"name":"Kishore Nallan","email":"kishore@kishorelive.com"},"contributors":[{"name":"Kishore Nallan","email":"kishore@kishorelive.com"}],"repository":{"type":"git","url":"git://github.com/kishorenc/road.git"},"bugs":{"email":"kishore@kishorelive.com","url":"https://github.com/kishorenc/road/issues"},"main":"index.js","engines":{"node":">=0.4.0"},"licenses":[{"type":"MIT","url":"https://raw.github.com/kishorenc/road/master/LICENSE"}],"_npmUser":{"name":"kishorenc","email":"kishore@kishorelive.com"},"_id":"road@0.2.5","dependencies":{},"devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.5","_defaultsLoaded":true,"dist":{"shasum":"0da629efe1b2bde5773ddcbcbde16272c421b21b","tarball":"https://registry.npmjs.org/road/-/road-0.2.5.tgz","integrity":"sha512-ybRRyXCPcnlKsbsyBeLoG7uCRWMJ3IIcvz5aRU9h2agzJOZqG7HlTAzHTi6D7fx9ma/sSlaPtvjPsyO45OLwWQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFFE5egE44ACxaLzuAZOVS5wRt/mJyInlzZiVWpPBIsZAiAQNh9QZ9oU4vbtMJU773lT3X3aF06GswqBk+f86lLNnw=="}]},"maintainers":[{"name":"kishorenc","email":"kishore@kishorelive.com"}]},"0.2.6":{"name":"road","version":"0.2.6","description":"A route helper for express.","homepage":"https://github.com/kishorenc/road","author":{"name":"Kishore Nallan","email":"kishore@kishorelive.com"},"contributors":[{"name":"Kishore Nallan","email":"kishore@kishorelive.com"}],"repository":{"type":"git","url":"git://github.com/kishorenc/road.git"},"bugs":{"email":"kishore@kishorelive.com","url":"https://github.com/kishorenc/road/issues"},"main":"index.js","engines":{"node":">=0.4.0"},"licenses":[{"type":"MIT","url":"https://raw.github.com/kishorenc/road/master/LICENSE"}],"_npmUser":{"name":"kishorenc","email":"kishore@kishorelive.com"},"_id":"road@0.2.6","dependencies":{},"devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.8","_defaultsLoaded":true,"dist":{"shasum":"a20d4d7f92af723790f0225ecf7f20609547dc92","tarball":"https://registry.npmjs.org/road/-/road-0.2.6.tgz","integrity":"sha512-WJuFa8t5i2YFuNvkNyN0XqODgjl3VikfD/aptrPYNFFeivO/Qkn0B1F8X1QwcPDt5DpV4+ymmp2YY29jmNNSSQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD494CWbOSxCefUrt01SrzQJJObbHtWGplwaMefOOomRQIgEM3AlUhTtdmwUDXgMEdKbB9sGhejNCUrTra66vDOWEU="}]},"maintainers":[{"name":"kishorenc","email":"kishore@kishorelive.com"}]},"0.2.7":{"name":"road","version":"0.2.7","description":"A route helper for express.","homepage":"https://github.com/kishorenc/road","author":{"name":"Kishore Nallan","email":"kishore@kishorelive.com"},"contributors":[{"name":"Kishore Nallan","email":"kishore@kishorelive.com"}],"repository":{"type":"git","url":"git://github.com/kishorenc/road.git"},"devDependencies":{"ejs":"*","mocha":"*","request":"*","express":"2.5.4"},"bugs":{"email":"kishore@kishorelive.com","url":"https://github.com/kishorenc/road/issues"},"main":"index.js","engines":{"node":">=0.4.0"},"licenses":[{"type":"MIT","url":"https://raw.github.com/kishorenc/road/master/LICENSE"}],"_npmUser":{"name":"kishorenc","email":"kishore@kishorelive.com"},"_id":"road@0.2.7","dependencies":{},"_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.8","_defaultsLoaded":true,"dist":{"shasum":"2b8f0b810b08f6fc1a3fb77c0111e726453b4804","tarball":"https://registry.npmjs.org/road/-/road-0.2.7.tgz","integrity":"sha512-d3GcXl550635W5RDCgffxgtByqyZ4HC7RQ9gSo9BSOyUgcWMWQSpkcop1f8/rxNZyUnAGCO8uNKcA48wVQKbPQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAdw2tYS9NBUiRI9VyjT8TEDmwHLFGXASaGnqgR4sNw4AiBgX8JBL9w9Ebh+OucXIMNZHAFuAaX9wduLVq9DhJuo6g=="}]},"maintainers":[{"name":"kishorenc","email":"kishore@kishorelive.com"}]},"0.2.8":{"name":"road","version":"0.2.8","description":"A route helper for express.","homepage":"https://github.com/kishorenc/road","author":{"name":"Kishore Nallan","email":"kishore@kishorelive.com"},"contributors":[{"name":"Kishore Nallan","email":"kishore@kishorelive.com"}],"repository":{"type":"git","url":"git://github.com/kishorenc/road.git"},"devDependencies":{"ejs":"*","mocha":"*","request":"*","express":"2.5.4"},"bugs":{"email":"kishore@kishorelive.com","url":"https://github.com/kishorenc/road/issues"},"main":"index.js","engines":{"node":">=0.4.0"},"licenses":[{"type":"MIT","url":"https://raw.github.com/kishorenc/road/master/LICENSE"}],"_npmUser":{"name":"kishorenc","email":"kishore@kishorelive.com"},"_id":"road@0.2.8","dependencies":{},"_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.8","_defaultsLoaded":true,"dist":{"shasum":"72a67694c0e9150cd500f6ccb63a386203454938","tarball":"https://registry.npmjs.org/road/-/road-0.2.8.tgz","integrity":"sha512-ooa4M19KIsQSLL/IcmikHxGt0Tlqy4txrqN1tisGf2Uo7hquNNQg0hh3D7k29ItPUK9vSZgDU9wDV+SvJHmfCg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBdFyIb6gDq+EdMPJ+Yz3NzjEkxx8mdzULe5PDEwOBcOAiAo+ueJyXfB//BN1s2yvZ2tBBzDmIn1ujqa3gDpn7hn6g=="}]},"maintainers":[{"name":"kishorenc","email":"kishore@kishorelive.com"}]},"0.3.0":{"name":"road","version":"0.3.0","description":"A route helper for express.","homepage":"https://github.com/kishorenc/road","author":{"name":"Kishore Nallan","email":"kishore@kishorelive.com"},"contributors":[{"name":"Kishore Nallan","email":"kishore@kishorelive.com"}],"repository":{"type":"git","url":"git://github.com/kishorenc/road.git"},"devDependencies":{"ejs":"*","mocha":"*","request":"*","express":"2.5.4"},"bugs":{"email":"kishore@kishorelive.com","url":"https://github.com/kishorenc/road/issues"},"main":"index.js","engines":{"node":">=0.4.0"},"licenses":[{"type":"MIT","url":"https://raw.github.com/kishorenc/road/master/LICENSE"}],"_npmUser":{"name":"kishorenc","email":"kishore@kishorelive.com"},"_id":"road@0.3.0","dependencies":{},"_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.8","_defaultsLoaded":true,"dist":{"shasum":"376361e689e1392cae2e1c0e382ac65efb18d676","tarball":"https://registry.npmjs.org/road/-/road-0.3.0.tgz","integrity":"sha512-BtFGX/BYclPtmTcQhPgSBzQUu+qOfK7jb/9CRZ2FwxGB2ORuKLaFoGfUpWAkHlUqC8FKcxs+UAVfaCx9zAcOCw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEpV1aP3uLUYTimPGPW3mAj2iMn7xNRV059GLweAb0J8AiA0QN0ac9obFXr1hdUTSSloTGoubSRxl7+XrYhIe8BRTg=="}]},"maintainers":[{"name":"kishorenc","email":"kishore@kishorelive.com"}]},"0.3.2":{"name":"road","version":"0.3.2","description":"A route helper for express.","homepage":"https://github.com/kishorenc/road","author":{"name":"Kishore Nallan","email":"kishore@kishorelive.com"},"contributors":[{"name":"Kishore Nallan","email":"kishore@kishorelive.com"}],"repository":{"type":"git","url":"git://github.com/kishorenc/road.git"},"devDependencies":{"ejs":"*","mocha":"*","request":"*","express":"2.5.4"},"bugs":{"email":"kishore@kishorelive.com","url":"https://github.com/kishorenc/road/issues"},"main":"index.js","engines":{"node":">=0.4.0"},"licenses":[{"type":"MIT","url":"https://raw.github.com/kishorenc/road/master/LICENSE"}],"_npmUser":{"name":"kishorenc","email":"kishore@kishorelive.com"},"_id":"road@0.3.2","dependencies":{},"_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.8","_defaultsLoaded":true,"dist":{"shasum":"3f224738c8fe6367d3c6c7ada827e55624f3e99d","tarball":"https://registry.npmjs.org/road/-/road-0.3.2.tgz","integrity":"sha512-akbiLd1bIejhXdkKIkywigfC+ZCuVz9/hCBZqqyKvHo/tKnemVg553mkFSWCdjEL4k7X47g2QljM/mMKOBCiKQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJweM8fe1AOA3ktgFO2zJGjnHVXFnNfqfHWNqOnprDiAIhAO716flplZt/yarL2plh+uvl00u011EO3b6W0bgihkBg"}]},"maintainers":[{"name":"kishorenc","email":"kishore@kishorelive.com"}]},"0.3.3":{"name":"road","version":"0.3.3","description":"A route helper for express.","homepage":"https://github.com/kishorenc/road","author":{"name":"Kishore Nallan","email":"kishore@kishorelive.com"},"contributors":[{"name":"Kishore Nallan","email":"kishore@kishorelive.com"}],"repository":{"type":"git","url":"git://github.com/kishorenc/road.git"},"devDependencies":{"ejs":"*","mocha":"*","request":"*","express":"2.5.4"},"bugs":{"email":"kishore@kishorelive.com","url":"https://github.com/kishorenc/road/issues"},"main":"index.js","engines":{"node":">=0.4.0"},"licenses":[{"type":"MIT","url":"https://raw.github.com/kishorenc/road/master/LICENSE"}],"_npmUser":{"name":"kishorenc","email":"kishore@kishorelive.com"},"_id":"road@0.3.3","dependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.16","_nodeVersion":"v0.6.14","_defaultsLoaded":true,"dist":{"shasum":"59161e82456991e5088b717dcf589a4e31040236","tarball":"https://registry.npmjs.org/road/-/road-0.3.3.tgz","integrity":"sha512-qYfU0RdFDP05fllkQhKRoxfkt3B7/nJ4bMncodYZT4heKRM38+ys9B548CcUyR12sMSnQ70TFoWk4dETA9zA0A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCeVMvz/Ohp7o0BGJ5BMdNBh2wuEQkruYkgXkdFW+IjRwIgKK1LT573R2iiV2UBBOo8zqPq1vFCGfhH3IqdlU1z+VY="}]},"readme":"#Road - route helper for Express\n\nA route helper for express that allows you to map routes, controllers and views by following logical conventions. See example application for use cases. You need express 2.x and ejs available to run the example.\n\n##Installation\n\n\tnpm install road\n\n##Features\n\n\t* Wire your routes to individual controllers and views using convention\n\t* Define custom routes which map custom URLs to specific controller methods\t\n\t* Serve the views in custom MIME types\n\t* View helper for serving JavaScript objects as application/json\n\t\n##Comptability\n\n\t* Works on both node 0.4.x and 0.6.x\n\t* Tested with Express 2.5.x\n\n##Changes in v0.3.x\n\nRoad 0.3.x breaks compatibility with 0.2.x with a number of API changes. To upgrade from 0.2.8, see the bottom of this page.\n\t\nSee example application for complete use cases.\n\n##Quick Start\n\nIntegrating Road with your Express application is really simple. Tell Express to let Road handle the routing this way:\n\n``` javascript\nvar road = require('road');\n\n// mount application routes using road\napp.use(express.router(road));\n```\n\nRoad, by convention, expects you to drop your controllers into the `controllers` folder in your application root. \n\n\t/controllers\n\t\t/indexController.js\n\t\t/eventsController.js\n\nYou can export your controller functions which automatically get mapped by road, again using convention. Every controller function needs to be prefixed with the HTTP method it's handling. For example, functions serving GET requests, need to be prefixed with `get_`, like this:\n\n``` javascript\n// eventsController.js\n\n// maps to: GET events/index or, just GET events/\nthis.get_index = function(req, res, callback) {\n\t/* ... */\n}\n\n// maps to: GET events/foo/ or, GET events/:id/foo\nthis.get_foo = function(req, res, callback) {\n\t/* ... */\n}\n```\n\nFor handling a POST request, use `post_` prefix:\n\n``` javascript\n// handles POST events/bar\nthis.post_bar = function(req, res, callback) {\n\t/* ... */\n}\n```\t\n\nInstead of using res.render() to render your views, you can use the controller function's `callback`, which provides you with useful shortcuts:\n\n``` javascript\n// serves the view file dynamic.ejs, along with the view data\nthis.get_dynamicView = function(req, res, callback) {\n    callback(null, 'dynamic', {name: \"Road.js\"});\n}\n\n// serves a view with custom MIME type (default is text/html)\nthis.get_dynamicViewAsPlainText = function(req, res, callback) {\n    callback(null, 'dynamic', {name:'Road.js'}, 'text/plain');\n}\n\n// serving plain text directly (no template)\nthis.get_plainText = function(req, res, callback) {\n    callback(null, {'text/plain': 'Plain text served as text/plain'});\n}\n\n// serving a JSON response (served as application/json)\nthis.get_jsonResponse = function(req, res, callback) {\n    var obj = {'foo': 'bar'};\n    callback(null, {'json': obj});\n}\n\n// for more use cases, see the example app\n```\n\n##Content negotation\n\nRoad provides a basic mechanism for content negotiation through the use of extension names. If a particular URL is called with an extension, `req.format` property is set the value of the extension. For example, when `foo/show.json` is called, the value of `req.format` will be `json'. Based on this, we can serve different content:\n\n``` javascript\nthis.get_contentNegotiation = function(req, res, callback) {\n\tvar names = ['Jack', 'Jane'];\n\tswitch(req.format) {\n\t\tcase 'json':\n\t\t\tcallback(null, {'json': names});\n\t\t\tbreak;\n\t\tcase 'html':\n\t\t\tvar html = '<strong>Jack, Jane</strong>';\n\t\t\tcallback(null, {'text/html': html});\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tcallback(new Error('Unsupported content type.'));\n\t}\n};\n```\n\nIf the URL is not called with any extension, `req.format` is by default set to `html`.\n\n##Redirection\n\nRoad also provides a helper for redirection:\n\n``` javascript\n// redirect a request to this controller method to the URL '/foo/redirectTarget'\nthis.get_redirectDefault = function(req, res, callback) {\n\tcallback(null, {'redirect': '/foo/redirectTarget'});\n};\n```\n\nRedirections are 302 by default, but you can also explicitly specify a 301 redirect:\n\n``` javascript\nthis.get_redirectWith301 = function(req, res, callback) {\n\tcallback(null, {'redirect': '/foo/redirectTarget'}, 301);\n};\n```\n\n##View files\n\nPlace your view files in `/views` directory in your application's root. Each controller gets its own sub-directory inside `views`. For example, if you have a `show` method in your `fooController.js`, accessing `foo/show` will make Road look for the template file `views/foo/show.ejs`.\n\n\t/controllers\n\t\t/fooController.js\n\n\t/views\n\t\t/foo\n\t\t\t/show.ejs\n\n##Configuration options\n\n**road.configure([options])**\n\nThe following properties can be set on the `options` object:\n\n* `viewEngine`: view engine to be used for rendering the views (e.g. ejs, jade). Default: `ejs`\n* `routes`: array with custom routing rules (see the following section on routing rules for more details)\n* `useLayout`: specifies whether Express should use a layout while rendering the view\n* `callback`: this callback will be fired when Road is done with its job\n\n##View helpers\n\nAs shown in the examples above, Road provides a wrapper over `res.render` and allows you to render your views by using the `callback` argument passed to your controller method. However, you can simply stick to `res.render` as well for rendering your views. Road uses `ejs` as the default view engine. To specify another view engine, e.g. jade, you can do so via the `viewEngine` configuration property.\n\n``` javascript\nroad.configure({viewEngine: 'jade'});\n```\n\n##Routing rules\n\nRoad supports the following routing rule by default:\n\n\t/:controller?/:id?/:action?  (for all HTTP verbs)\n\nTo define custom routes, place a route file in your application's root. Any routing rule defined in `routes.js` will take precedence over the default routing rules above.\n\n``` javascript\n// routes.js (place this in your application root)\nmodule.exports = [\n\t\n\t// routes `/path/to/foo` to `get_show()` method of `fooController`\n\t['get', '/path/to/foo/:id', 'foo', 'show'],\n\n];\n```\n\nWhen you configure Road, you pass these routes using the `routes` property of the configuration options this way:\n\n``` javascript\nroad.configure({routes: require('./routes')});\n```\n\n##Registering a callback\n\nFinally, if you want to register a callback for Road to call when it's done rendering the view (or encounters an error), you can do so like this:\n\n``` javascript\nfunction roadCallback(err, req, res, next) {\n\tif(err) return next(err);\n\t// else, do something ...\n}\nroad.configure({callback: roadCallback});\n```\n\nRoad sets a `status` property on the callback's `err` argument to indicate the type of error. This can be used for rendering an appropriate view with the correct HTTP status code. For missing controller or controller methods, `err.status` is set to 404 (to indicate a missing resource), while any other error passed to Road from a controller method is set to 500. If the error object already has a status set, Road does not override that.\n\n##Upgrading to v0.3.0 from v0.2.8\n\n* Deprecated use of keyword 'map' as the first element in route mapping array. A route mapping is now simply defined as:\n    \n    ``` javascript\n    // routes.js\n    module.exports = [\n        ['get', '/customPath', 'controllerName', 'methodName'],\n    ]\n    ```\n\n* `road.configure()` now takes a configuration object.\n* `road.use()` is deprecated. To initialize Road, simply pass it to Express this way: `app.use(express.router(road));` \n* Changed the default route convention from `controller/:action/:id` to `controller/:id/:action`\n\n##Running the tests\n\nTo run the tests, first install the dev dependencies (ejs, mocha and request):\n\n\t$ npm install\n\t$ npm install -g mocha\n\nRun the tests from the test folder this way:\n\n\t$ mocha test.js\n\n##License\n\n(The MIT License)\n\nCopyright (c) 2011 Kishore Nallan  <kishore@kishorelive.com>\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":"kishorenc","email":"kishore@kishorelive.com"}]},"0.3.4":{"name":"road","version":"0.3.4","description":"A route helper for express.","homepage":"https://github.com/kishorenc/road","author":{"name":"Kishore Nallan","email":"kishore@kishorelive.com"},"contributors":[{"name":"Kishore Nallan","email":"kishore@kishorelive.com"}],"repository":{"type":"git","url":"git://github.com/kishorenc/road.git"},"devDependencies":{"ejs":"*","mocha":"*","request":"*","express":"2.5.4"},"bugs":{"email":"kishore@kishorelive.com","url":"https://github.com/kishorenc/road/issues"},"main":"index.js","engines":{"node":">=0.4.0"},"licenses":[{"type":"MIT","url":"https://raw.github.com/kishorenc/road/master/LICENSE"}],"_npmUser":{"name":"kishorenc","email":"kishore@kishorelive.com"},"_id":"road@0.3.4","dependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.16","_nodeVersion":"v0.6.14","_defaultsLoaded":true,"dist":{"shasum":"d79e2f7fe736ee9d42f2495e748d5f6f8f0f039c","tarball":"https://registry.npmjs.org/road/-/road-0.3.4.tgz","integrity":"sha512-GD1FfYPlMYEQnNmcaekXAyPx/AizzJLC/qOjuEzzPRjIgrk+D3TyQX+FfMHmQlo4T4TjnIS1Xiotf7Ql5uSYuQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD3+u0rRz2WQimTuZImb53cQNALaW7tnbWsAmQjW71FSwIhAN6grHZTnP7gRPSp3s63wUlVtHoL9DbJ3nA1ajNIkJBX"}]},"readme":"#Road - route helper for Express\n\nA route helper for express that allows you to map routes, controllers and views by following logical conventions. See example application for use cases. You need express 2.x and ejs available to run the example.\n\n##Installation\n\n\tnpm install road\n\n##Features\n\n\t* Wire your routes to individual controllers and views using convention\n\t* Define custom routes which map custom URLs to specific controller methods\t\n\t* Serve the views in custom MIME types\n\t* View helper for serving JavaScript objects as application/json\n\t\n##Comptability\n\n\t* Works on both node 0.4.x and 0.6.x\n\t* Tested with Express 2.5.x\n\n##Changes in v0.3.x\n\nRoad 0.3.x breaks compatibility with 0.2.x with a number of API changes. To upgrade from 0.2.8, see the bottom of this page.\n\t\nSee example application for complete use cases.\n\n##Quick Start\n\nIntegrating Road with your Express application is really simple. Tell Express to let Road handle the routing this way:\n\n``` javascript\nvar road = require('road');\n\n// mount application routes using road\napp.use(express.router(road));\n```\n\nRoad, by convention, expects you to drop your controllers into the `controllers` folder in your application root. \n\n\t/controllers\n\t\t/indexController.js\n\t\t/eventsController.js\n\nYou can export your controller functions which automatically get mapped by road, again using convention. Every controller function needs to be prefixed with the HTTP method it's handling. For example, functions serving GET requests, need to be prefixed with `get_`, like this:\n\n``` javascript\n// eventsController.js\n\n// maps to: GET events/index or, just GET events/\nthis.get_index = function(req, res, callback) {\n\t/* ... */\n}\n\n// maps to: GET events/foo/ or, GET events/:id/foo\nthis.get_foo = function(req, res, callback) {\n\t/* ... */\n}\n```\n\nFor handling a POST request, use `post_` prefix:\n\n``` javascript\n// handles POST events/bar\nthis.post_bar = function(req, res, callback) {\n\t/* ... */\n}\n```\t\n\nInstead of using res.render() to render your views, you can use the controller function's `callback`, which provides you with useful shortcuts:\n\n``` javascript\n// serves the view file dynamic.ejs, along with the view data\nthis.get_dynamicView = function(req, res, callback) {\n    callback(null, 'dynamic', {name: \"Road.js\"});\n}\n\n// serves a view with custom MIME type (default is text/html)\nthis.get_dynamicViewAsPlainText = function(req, res, callback) {\n    callback(null, 'dynamic', {name:'Road.js'}, 'text/plain');\n}\n\n// serving plain text directly (no template)\nthis.get_plainText = function(req, res, callback) {\n    callback(null, {'text/plain': 'Plain text served as text/plain'});\n}\n\n// serving a JSON response (served as application/json)\nthis.get_jsonResponse = function(req, res, callback) {\n    var obj = {'foo': 'bar'};\n    callback(null, {'json': obj});\n}\n\n// for more use cases, see the example app\n```\n\n##Content negotation\n\nRoad provides a basic mechanism for content negotiation through the use of extension names. If a particular URL is called with an extension, `req.format` property is set the value of the extension. For example, when `foo/show.json` is called, the value of `req.format` will be `json'. Based on this, we can serve different content:\n\n``` javascript\nthis.get_contentNegotiation = function(req, res, callback) {\n\tvar names = ['Jack', 'Jane'];\n\tswitch(req.format) {\n\t\tcase 'json':\n\t\t\tcallback(null, {'json': names});\n\t\t\tbreak;\n\t\tcase 'html':\n\t\t\tvar html = '<strong>Jack, Jane</strong>';\n\t\t\tcallback(null, {'text/html': html});\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tcallback(new Error('Unsupported content type.'));\n\t}\n};\n```\n\nIf the URL is not called with any extension, `req.format` is by default set to `html`.\n\n##Redirection\n\nRoad also provides a helper for redirection:\n\n``` javascript\n// redirect a request to this controller method to the URL '/foo/redirectTarget'\nthis.get_redirectDefault = function(req, res, callback) {\n\tcallback(null, {'redirect': '/foo/redirectTarget'});\n};\n```\n\nRedirections are 302 by default, but you can also explicitly specify a 301 redirect:\n\n``` javascript\nthis.get_redirectWith301 = function(req, res, callback) {\n\tcallback(null, {'redirect': '/foo/redirectTarget'}, 301);\n};\n```\n\n##View files\n\nPlace your view files in `/views` directory in your application's root. Each controller gets its own sub-directory inside `views`. For example, if you have a `show` method in your `fooController.js`, accessing `foo/show` will make Road look for the template file `views/foo/show.ejs`.\n\n\t/controllers\n\t\t/fooController.js\n\n\t/views\n\t\t/foo\n\t\t\t/show.ejs\n\n##Configuration options\n\n**road.configure([options])**\n\nThe following properties can be set on the `options` object:\n\n* `viewEngine`: view engine to be used for rendering the views (e.g. ejs, jade). Default: `ejs`\n* `routes`: array with custom routing rules (see the following section on routing rules for more details)\n* `useLayout`: specifies whether Express should use a layout while rendering the view\n* `callback`: this callback will be fired when Road is done with its job\n\n##View helpers\n\nAs shown in the examples above, Road provides a wrapper over `res.render` and allows you to render your views by using the `callback` argument passed to your controller method. However, you can simply stick to `res.render` as well for rendering your views. Road uses `ejs` as the default view engine. To specify another view engine, e.g. jade, you can do so via the `viewEngine` configuration property.\n\n``` javascript\nroad.configure({viewEngine: 'jade'});\n```\n\n##Routing rules\n\nRoad supports the following routing rule by default:\n\n\t/:controller?/:id?/:action?  (for all HTTP verbs)\n\nTo define custom routes, place a route file in your application's root. Any routing rule defined in `routes.js` will take precedence over the default routing rules above.\n\n``` javascript\n// routes.js (place this in your application root)\nmodule.exports = [\n\t\n\t// routes `/path/to/foo` to `get_show()` method of `fooController`\n\t['get', '/path/to/foo/:id', 'foo', 'show'],\n\n];\n```\n\nWhen you configure Road, you pass these routes using the `routes` property of the configuration options this way:\n\n``` javascript\nroad.configure({routes: require('./routes')});\n```\n\n##Registering a callback\n\nFinally, if you want to register a callback for Road to call when it's done rendering the view (or encounters an error), you can do so like this:\n\n``` javascript\nfunction roadCallback(err, req, res, next) {\n\tif(err) return next(err);\n\t// else, do something ...\n}\nroad.configure({callback: roadCallback});\n```\n\nRoad sets a `status` property on the callback's `err` argument to indicate the type of error. This can be used for rendering an appropriate view with the correct HTTP status code. For missing controller or controller methods, `err.status` is set to 404 (to indicate a missing resource), while any other error passed to Road from a controller method is set to 500. If the error object already has a status set, Road does not override that.\n\n##Upgrading to v0.3.0 from v0.2.8\n\n* Deprecated use of keyword 'map' as the first element in route mapping array. A route mapping is now simply defined as:\n    \n    ``` javascript\n    // routes.js\n    module.exports = [\n        ['get', '/customPath', 'controllerName', 'methodName'],\n    ]\n    ```\n\n* `road.configure()` now takes a configuration object.\n* `road.use()` is deprecated. To initialize Road, simply pass it to Express this way: `app.use(express.router(road));` \n* Changed the default route convention from `controller/:action/:id` to `controller/:id/:action`\n\n##Running the tests\n\nTo run the tests, first install the dev dependencies (ejs, mocha and request):\n\n\t$ npm install\n\t$ npm install -g mocha\n\nRun the tests from the test folder this way:\n\n\t$ mocha test.js\n\n##License\n\n(The MIT License)\n\nCopyright (c) 2011 Kishore Nallan  <kishore@kishorelive.com>\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":"kishorenc","email":"kishore@kishorelive.com"}]},"0.4.0":{"name":"road","version":"0.4.0","description":"A route helper for express.","homepage":"https://github.com/kishorenc/road","author":{"name":"Kishore Nallan","email":"kishore@kishorelive.com"},"contributors":[{"name":"Kishore Nallan","email":"kishore@kishorelive.com"}],"repository":{"type":"git","url":"https://github.com/kishorenc/road"},"devDependencies":{"ejs":"*","mocha":"*","request":"*","express":"3.x"},"bugs":{"mail":"kishore@kishorelive.com","url":"https://github.com/kishorenc/road/issues"},"main":"index.js","engines":{"node":">=0.4.0"},"licenses":[{"type":"MIT","url":"https://raw.github.com/kishorenc/road/master/LICENSE"}],"readme":"#Road - route helper for Express\n\nA route helper for express that allows you to map routes, controllers and views by following logical conventions. See example application for use cases. You need Express 3.x or Express 2.x and ejs available to run the example.\n\n##Installation\n\n\tnpm install road\n\n## Express 3.x\n\nThe following guide is for Express 3.x. If you using Express 2.x, please refer to the `0.3` branch for instructions.\n\n##Features\n\n\t* Wire your routes to individual controllers and views using convention\n\t* Define custom routes which map custom URLs to specific controller methods\t\n\t* Serve the views in custom MIME types\n\t* View helper for serving JavaScript objects as application/json\n\t\n##Compatibility\n\n\t* Tested with Express 3.x and Express 2.x\n\n##v0.4.0\n\nRoad 0.4.x is compatible with Express 3.x. Road also works on Express 2.x, but you have to check the `0.3` branch for instructions.\n\n##Changes in v0.3.x\n\nRoad 0.3.x breaks compatibility with 0.2.x with a number of API changes. To upgrade from 0.2.8, see the bottom of this page.\n\t\nSee example application for complete use cases.\n\n##Quick Start\n\nIntegrating Road with your Express application is really simple.\n\n``` javascript\n// create an express app\nvar app = express();\n\n// initialize road this way\nvar road = require('road');\nroad(app);\n```\n\nRoad, by convention, expects you to drop your controllers into the `controllers` folder in your application root. \n\n\t/controllers\n\t\t/indexController.js\n\t\t/eventsController.js\n\nYou can export your controller functions which automatically get mapped by road, again using convention. Every controller function needs to be prefixed with the HTTP method it's handling. For example, functions serving GET requests, need to be prefixed with `get_`, like this:\n\n``` javascript\n// eventsController.js\n\n// maps to: GET events/index or, just GET events/\nthis.get_index = function(req, res, callback) {\n\t/* ... */\n}\n\n// maps to: GET events/foo/ or, GET events/:id/foo\nthis.get_foo = function(req, res, callback) {\n\t/* ... */\n}\n```\n\nFor handling a POST request, use `post_` prefix:\n\n``` javascript\n// handles POST events/bar\nthis.post_bar = function(req, res, callback) {\n\t/* ... */\n}\n```\t\n\nInstead of using res.render() to render your views, you can use the controller function's `callback`, which provides you with useful shortcuts:\n\n``` javascript\n// serves the view file dynamic.ejs, along with the view data\nthis.get_dynamicView = function(req, res, callback) {\n    callback(null, 'dynamic', {name: \"Road.js\"});\n}\n\n// serves a view with custom MIME type (default is text/html)\nthis.get_dynamicViewAsPlainText = function(req, res, callback) {\n    callback(null, 'dynamic', {name:'Road.js'}, 'text/plain');\n}\n\n// serving plain text directly (no template)\nthis.get_plainText = function(req, res, callback) {\n    callback(null, {'text/plain': 'Plain text served as text/plain'});\n}\n\n// serving a JSON response (served as application/json)\nthis.get_jsonResponse = function(req, res, callback) {\n    var obj = {'foo': 'bar'};\n    callback(null, {'json': obj});\n}\n\n// for more use cases, see the example app\n```\n\n##Content negotation\n\nRoad provides a basic mechanism for content negotiation through the use of extension names. If a particular URL is called with an extension, `req.format` property is set the value of the extension. For example, when `foo/show.json` is called, the value of `req.format` will be `json'. Based on this, we can serve different content:\n\n``` javascript\nthis.get_contentNegotiation = function(req, res, callback) {\n\tvar names = ['Jack', 'Jane'];\n\tswitch(req.format) {\n\t\tcase 'json':\n\t\t\tcallback(null, {'json': names});\n\t\t\tbreak;\n\t\tcase 'html':\n\t\t\tvar html = '<strong>Jack, Jane</strong>';\n\t\t\tcallback(null, {'text/html': html});\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tcallback(new Error('Unsupported content type.'));\n\t}\n};\n```\n\nIf the URL is not called with any extension, `req.format` is by default set to `html`.\n\n##Redirection\n\nRoad also provides a helper for redirection:\n\n``` javascript\n// redirect a request to this controller method to the URL '/foo/redirectTarget'\nthis.get_redirectDefault = function(req, res, callback) {\n\tcallback(null, {'redirect': '/foo/redirectTarget'});\n};\n```\n\nRedirections are 302 by default, but you can also explicitly specify a 301 redirect:\n\n``` javascript\nthis.get_redirectWith301 = function(req, res, callback) {\n\tcallback(null, {'redirect': '/foo/redirectTarget'}, 301);\n};\n```\n\n##View files\n\nPlace your view files in `/views` directory in your application's root. Each controller gets its own sub-directory inside `views`. For example, if you have a `show` method in your `fooController.js`, accessing `foo/show` will make Road look for the template file `views/foo/show.ejs`.\n\n\t/controllers\n\t\t/fooController.js\n\n\t/views\n\t\t/foo\n\t\t\t/show.ejs\n\n##Configuration options\n\n**road.configure([options])**\n\nThe following properties can be set on the `options` object:\n\n* `viewEngine`: view engine to be used for rendering the views (e.g. ejs, jade). Default: `ejs`\n* `routes`: array with custom routing rules (see the following section on routing rules for more details)\n* `useLayout`: specifies whether Express should use a layout while rendering the view\n* `callback`: this callback will be fired when Road is done with its job\n\n##View helpers\n\nAs shown in the examples above, Road provides a wrapper over `res.render` and allows you to render your views by using the `callback` argument passed to your controller method. However, you can simply stick to `res.render` as well for rendering your views. Road uses `ejs` as the default view engine. To specify another view engine, e.g. jade, you can do so via the `viewEngine` configuration property.\n\n``` javascript\nroad.configure({viewEngine: 'jade'});\n```\n\n##Routing rules\n\nRoad supports the following routing rule by default:\n\n\t/:controller?/:id?/:action?  (for all HTTP verbs)\n\nTo define custom routes, place a route file in your application's root. Any routing rule defined in `routes.js` will take precedence over the default routing rules above.\n\n``` javascript\n// routes.js (place this in your application root)\nmodule.exports = [\n\t\n\t// routes `/path/to/foo` to `get_show()` method of `fooController`\n\t['get', '/path/to/foo/:id', 'foo', 'show'],\n\n];\n```\n\nWhen you configure Road, you pass these routes using the `routes` property of the configuration options this way:\n\n``` javascript\nroad.configure({routes: require('./routes')});\n```\n\n##Registering a callback\n\nFinally, if you want to register a callback for Road to call when it's done rendering the view (or encounters an error), you can do so like this:\n\n``` javascript\nfunction roadCallback(err, req, res, next) {\n\tif(err) return next(err);\n\t// else, do something ...\n}\nroad.configure({callback: roadCallback});\n```\n\nRoad sets a `status` property on the callback's `err` argument to indicate the type of error. This can be used for rendering an appropriate view with the correct HTTP status code. For missing controller or controller methods, `err.status` is set to 404 (to indicate a missing resource), while any other error passed to Road from a controller method is set to 500. If the error object already has a status set, Road does not override that.\n\n##Upgrading to v0.3.0 from v0.2.8\n\n* Deprecated use of keyword 'map' as the first element in route mapping array. A route mapping is now simply defined as:\n    \n    ``` javascript\n    // routes.js\n    module.exports = [\n        ['get', '/customPath', 'controllerName', 'methodName'],\n    ]\n    ```\n\n* `road.configure()` now takes a configuration object.\n* `road.use()` is deprecated. To initialize Road, simply pass it to Express this way: `app.use(express.router(road));` \n* Changed the default route convention from `controller/:action/:id` to `controller/:id/:action`\n\n##Running the tests\n\nTo run the tests, first install the dev dependencies (ejs, mocha and request):\n\n\t$ npm install\n\t$ npm install -g mocha\n\nRun the tests from the test folder this way:\n\n\t$ mocha test.js\n\n##License\n\n(The MIT License)\n\nCopyright (c) 2011-2012 Kishore Nallan  <kishore@kishorelive.com>\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","readmeFilename":"README.md","_id":"road@0.4.0","dist":{"shasum":"aabf6c5e6fd05b67015afd72a6092145f93af452","tarball":"https://registry.npmjs.org/road/-/road-0.4.0.tgz","integrity":"sha512-lEw3CGtFK2G0l26yZIYptQxL16C7HZChd3mRWmtNcg5SjIKYGOYDzgaYlQVxXuhEY3NKJLwQDhV9IzSv90QLvQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHUyi9hXP1cyhTAR/Ug4QtBIMjI5qoO7V1ZAhVDOhrMTAiEAsOxF+5wO++RvVnKRI/mCq3o1kpf3qDunDZ7VE3JHVPM="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"kishorenc","email":"kishore@kishorelive.com"},"maintainers":[{"name":"kishorenc","email":"kishore@kishorelive.com"}]}},"maintainers":[{"name":"kishorenc","email":"kishore@kishorelive.com"}],"time":{"modified":"2022-06-26T13:42:24.897Z","created":"2011-11-14T13:27:50.406Z","0.0.1":"2011-11-14T13:36:44.424Z","0.0.2":"2011-11-14T13:39:29.904Z","0.0.3":"2011-11-28T02:02:35.309Z","0.1.2":"2011-12-23T14:21:46.100Z","0.2.0":"2011-12-23T15:32:36.228Z","0.2.1":"2011-12-23T16:10:10.026Z","0.2.2":"2011-12-23T17:29:13.232Z","0.2.3":"2011-12-23T19:14:35.876Z","0.2.4":"2011-12-31T17:34:08.281Z","0.2.5":"2012-01-21T06:13:51.743Z","0.2.6":"2012-01-26T13:23:09.511Z","0.2.7":"2012-01-28T12:25:14.068Z","0.2.8":"2012-02-12T08:19:40.690Z","0.3.0":"2012-03-18T14:03:59.162Z","0.3.2":"2012-04-06T12:00:30.748Z","0.3.3":"2012-06-24T05:57:13.712Z","0.3.4":"2012-06-24T06:03:37.150Z","0.4.0":"2012-12-26T15:40:33.867Z"},"author":{"name":"Kishore Nallan","email":"kishore@kishorelive.com"},"repository":{"type":"git","url":"https://github.com/kishorenc/road"}}