{"_id":"restify-router","_rev":"23-f789997dd46800e9621aabe5939dee72","name":"restify-router","description":"A router interface for restify that lets you aggregate route definitions and apply to a restify server","dist-tags":{"latest":"0.6.2"},"versions":{"0.1.0":{"name":"restify-router","version":"0.1.0","description":"A router interface for restify that lets you aggregate route definitions and apply to a restify server","main":"index.js","scripts":{"test":"mocha"},"keywords":["restify","router"],"author":"","license":"ISC","devDependencies":{"chai":"^3.3.0","gulp":"^3.9.0","gulp-istanbul":"^0.10.0","gulp-jscs":"^3.0.0","gulp-jshint":"^1.11.2","gulp-jshint-html-reporter":"^0.1.3","gulp-mocha":"^2.1.3","gulp-util":"^3.0.6","jscs-stylish":"^0.3.1","jshint-stylish":"^2.0.1","mocha":"^2.3.3","sinon":"^1.17.0","supertest":"^1.1.0"},"dependencies":{"assert-plus":"^0.1.5","lodash":"^3.10.1","restify":"^4.0.3"},"gitHead":"83fc4356d946b017e28157d263ec562cc2d44b6f","_id":"restify-router@0.1.0","_shasum":"c735a31bf4298c33270b9e013370719a421eda3f","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.1","_npmUser":{"name":"kayaniu","email":"kayani.u@gmail.com"},"dist":{"shasum":"c735a31bf4298c33270b9e013370719a421eda3f","tarball":"https://registry.npmjs.org/restify-router/-/restify-router-0.1.0.tgz","integrity":"sha512-U4rBXwtddC28ShG1Z4fhGrfok9lwVeHSij0ORLwk+iIwJyXdM6s8RDWJZ8CujsC0jawrqZNqTQt/3Wc8GyHlfA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDobeKkEQhGmNHUF6twF2VYpk4Cp5OPkTCWaDt/cmCmkgIgI2Ke4eJyx2/EMQIVNHTG4YtiCKsg+OLQcfBL9kdsD34="}]},"maintainers":[{"name":"kayaniu","email":"kayani.u@gmail.com"}],"directories":{}},"0.1.1":{"name":"restify-router","version":"0.1.1","description":"A router interface for restify that lets you aggregate route definitions and apply to a restify server","main":"index.js","scripts":{"test":"mocha"},"keywords":["restify","router"],"author":"","license":"ISC","devDependencies":{"chai":"^3.3.0","gulp":"^3.9.0","gulp-istanbul":"^0.10.0","gulp-jscs":"^3.0.0","gulp-jshint":"^1.11.2","gulp-jshint-html-reporter":"^0.1.3","gulp-mocha":"^2.1.3","gulp-util":"^3.0.6","jscs-stylish":"^0.3.1","jshint-stylish":"^2.0.1","mocha":"^2.3.3","sinon":"^1.17.0","supertest":"^1.1.0"},"dependencies":{"assert-plus":"^0.1.5","lodash":"^3.10.1","restify":"^4.0.3"},"gitHead":"f1090322e618f933ee9b91f5ea102ef088b1297e","_id":"restify-router@0.1.1","_shasum":"e449ca9096a329162fd340427416a80e76432edc","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.1","_npmUser":{"name":"kayaniu","email":"kayani.u@gmail.com"},"dist":{"shasum":"e449ca9096a329162fd340427416a80e76432edc","tarball":"https://registry.npmjs.org/restify-router/-/restify-router-0.1.1.tgz","integrity":"sha512-MZw+b55TK4gljD/KKXeSrtMKjsyuxfhAh31kEXMwQhRXiVQsgbTBIEEVFobl4WKMUAm5Xl88ZqNzsHBZaeZi9A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDifa/jS4NPOnMJE2a4/hPMkVgZbEujHR6MBv2/42Ng/QIgexN7ceGGGfi3aIEmYz3giN/Mwusgse+xmX3J7n//Gt4="}]},"maintainers":[{"name":"kayaniu","email":"kayani.u@gmail.com"}],"directories":{}},"0.1.2":{"name":"restify-router","version":"0.1.2","description":"A router interface for restify that lets you aggregate route definitions and apply to a restify server","main":"index.js","repository":{"type":"git","url":"git+https://github.com/kayaniu/restify-router.git"},"scripts":{"test":"mocha"},"keywords":["restify","router"],"author":{"name":"kayaniu"},"license":"ISC","devDependencies":{"chai":"^3.3.0","gulp":"^3.9.0","gulp-istanbul":"^0.10.0","gulp-jscs":"^3.0.0","gulp-jshint":"^1.11.2","gulp-jshint-html-reporter":"^0.1.3","gulp-mocha":"^2.1.3","gulp-util":"^3.0.6","jscs-stylish":"^0.3.1","jshint-stylish":"^2.0.1","mocha":"^2.3.3","sinon":"^1.17.0","supertest":"^1.1.0"},"dependencies":{"assert-plus":"^0.1.5","lodash":"^3.10.1","restify":"^4.0.3"},"gitHead":"077d73ad2ccdd6491e51425c743123daa54bbe67","bugs":{"url":"https://github.com/kayaniu/restify-router/issues"},"homepage":"https://github.com/kayaniu/restify-router#readme","_id":"restify-router@0.1.2","_shasum":"bb14307876af26d440419d50ec9fe0758aa5d42e","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.1","_npmUser":{"name":"kayaniu","email":"kayani.u@gmail.com"},"dist":{"shasum":"bb14307876af26d440419d50ec9fe0758aa5d42e","tarball":"https://registry.npmjs.org/restify-router/-/restify-router-0.1.2.tgz","integrity":"sha512-sAUYdhCUbTu3hr1FzRgr3TUJBia/SZPOF4ICcCtiscl5yE+hQ/C0Y0u0WWCIOF5cHkrWD70oonc0uECBYHUG4g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH4uPM3pTo9u0cxQCWnhVJTTiz5+JjUq6hIp8VLfoZr3AiBgLvh4YDIoUqou83GUeVksqgTzrzVRThFG6axPn1MUIA=="}]},"maintainers":[{"name":"kayaniu","email":"kayani.u@gmail.com"}],"directories":{}},"0.1.3":{"name":"restify-router","version":"0.1.3","description":"A router interface for restify that lets you aggregate route definitions and apply to a restify server","main":"index.js","repository":{"type":"git","url":"git+https://github.com/kayaniu/restify-router.git"},"scripts":{"test":"mocha"},"keywords":["restify","router"],"author":{"name":"kayaniu"},"license":"ISC","devDependencies":{"chai":"^3.3.0","gulp":"^3.9.0","gulp-istanbul":"^0.10.0","gulp-jscs":"^3.0.0","gulp-jshint":"^1.11.2","gulp-jshint-html-reporter":"^0.1.3","gulp-mocha":"^2.1.3","gulp-util":"^3.0.6","jscs-stylish":"^0.3.1","jshint-stylish":"^2.0.1","mocha":"^2.3.3","sinon":"^1.17.0","supertest":"^1.1.0"},"dependencies":{"assert-plus":"^0.1.5","lodash":"^3.10.1","restify":"^4.0.3"},"gitHead":"9bfa077112ebdb8c67fba120827362db9587a5e1","bugs":{"url":"https://github.com/kayaniu/restify-router/issues"},"homepage":"https://github.com/kayaniu/restify-router#readme","_id":"restify-router@0.1.3","_shasum":"57ec2c6d0bbf7522e21ff14f5f2ec82173697920","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.1","_npmUser":{"name":"kayaniu","email":"kayani.u@gmail.com"},"dist":{"shasum":"57ec2c6d0bbf7522e21ff14f5f2ec82173697920","tarball":"https://registry.npmjs.org/restify-router/-/restify-router-0.1.3.tgz","integrity":"sha512-JAd10SjBRhx1gLv/hgkL+z9umggtU4Bq8MduRgQbZ29dr8LrjRpvXbRlJV5oiFUF/z2eR14W2LdMHh8damGMow==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCGsly/clxX7uqQuhBlrmccr5zG58q3YyKotj4LXrxboAIgMYATBNir/wzVuMf++DTEfgdQltuRKsWSR/s3EAeFy8g="}]},"maintainers":[{"name":"kayaniu","email":"kayani.u@gmail.com"}],"directories":{}},"0.2.0":{"name":"restify-router","version":"0.2.0","description":"A router interface for restify that lets you aggregate route definitions and apply to a restify server","main":"index.js","repository":{"type":"git","url":"git+https://github.com/kayaniu/restify-router.git"},"scripts":{"test":"mocha"},"keywords":["restify","router"],"author":{"name":"kayaniu"},"license":"ISC","devDependencies":{"chai":"^3.3.0","gulp":"^3.9.0","gulp-istanbul":"^0.10.0","gulp-jscs":"^3.0.0","gulp-jshint":"^1.11.2","gulp-jshint-html-reporter":"^0.1.3","gulp-mocha":"^2.1.3","gulp-util":"^3.0.6","jscs-stylish":"^0.3.1","jshint-stylish":"^2.0.1","mocha":"^2.3.3","sinon":"^1.17.0","supertest":"^1.1.0"},"dependencies":{"assert-plus":"^0.1.5","lodash":"^3.10.1","restify":"^4.0.3"},"gitHead":"8fd863d9cfa86e33f09d16e30f50128e35033dc0","bugs":{"url":"https://github.com/kayaniu/restify-router/issues"},"homepage":"https://github.com/kayaniu/restify-router#readme","_id":"restify-router@0.2.0","_shasum":"8cf3e9b879a5031e03cbf9dd21ea1bded5e27bd6","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.1","_npmUser":{"name":"kayaniu","email":"kayani.u@gmail.com"},"dist":{"shasum":"8cf3e9b879a5031e03cbf9dd21ea1bded5e27bd6","tarball":"https://registry.npmjs.org/restify-router/-/restify-router-0.2.0.tgz","integrity":"sha512-OygdkLIY4LPYem8Nfqy2awwWK8Hv2kfbE2Yi3v7oT6wzotuHFv0ZMTG+hc/875fFRi8zhfegp3oKQroIt472hw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICqWHmh/LRMKyCMfPpnFVrfCtpSJzQIy9CZ0RakqStjjAiEA00NqS12AgjgcplSpn1nFjZ2p47dtHaP7WWIN99dzDNI="}]},"maintainers":[{"name":"kayaniu","email":"kayani.u@gmail.com"}],"directories":{}},"0.2.1":{"name":"restify-router","version":"0.2.1","description":"A router interface for restify that lets you aggregate route definitions and apply to a restify server","main":"index.js","repository":{"type":"git","url":"git+https://github.com/kayaniu/restify-router.git"},"scripts":{"test":"mocha"},"keywords":["restify","router"],"author":{"name":"kayaniu"},"license":"ISC","devDependencies":{"chai":"^3.3.0","gulp":"^3.9.0","gulp-istanbul":"^0.10.0","gulp-jscs":"^3.0.0","gulp-jshint":"^1.11.2","gulp-jshint-html-reporter":"^0.1.3","gulp-mocha":"^2.1.3","gulp-util":"^3.0.6","jscs-stylish":"^0.3.1","jshint-stylish":"^2.0.1","mocha":"^2.3.3","sinon":"^1.17.0","supertest":"^1.1.0"},"dependencies":{"assert-plus":"^0.1.5","lodash":"^3.10.1","restify":"^4.0.3"},"gitHead":"067ffbde54853f61c73b964d6c9391f2e1574cd7","bugs":{"url":"https://github.com/kayaniu/restify-router/issues"},"homepage":"https://github.com/kayaniu/restify-router#readme","_id":"restify-router@0.2.1","_shasum":"76c61cce46c9022b6d8f43615a421f8cc13e63fb","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.1","_npmUser":{"name":"kayaniu","email":"kayani.u@gmail.com"},"dist":{"shasum":"76c61cce46c9022b6d8f43615a421f8cc13e63fb","tarball":"https://registry.npmjs.org/restify-router/-/restify-router-0.2.1.tgz","integrity":"sha512-MWdsnZxlsKaHrRU4lwMVR31BRUq5qwlUdIEpXbuXwAppP1KUZj0PfkpwkYqIRzBoDFXx8Ck4Ig4U44BTZD+yvg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHRHgQ3gwT50CM3vryQ4EHTBUm5Q5SGe/PSnRQlBB6a7AiBgGEEKBz2K6ES0iJx8BenXN5OOC5qMYgTXwetqMYAE/g=="}]},"maintainers":[{"name":"kayaniu","email":"kayani.u@gmail.com"}],"directories":{}},"0.3.0":{"name":"restify-router","version":"0.3.0","description":"A router interface for restify that lets you aggregate route definitions and apply to a restify server","main":"index.js","repository":{"type":"git","url":"git+https://github.com/ukayani/restify-router.git"},"scripts":{"test":"mocha"},"keywords":["restify","router"],"author":{"name":"ukayani"},"license":"ISC","devDependencies":{"chai":"^3.3.0","gulp":"^3.9.0","gulp-istanbul":"^0.10.0","gulp-jscs":"^3.0.0","gulp-jshint":"^1.11.2","gulp-jshint-html-reporter":"^0.1.3","gulp-mocha":"^2.1.3","gulp-util":"^3.0.6","jscs-stylish":"^0.3.1","jshint-stylish":"^2.0.1","mocha":"^2.3.3","sinon":"^1.17.0","supertest":"^1.1.0","restify":"^4.0.3"},"dependencies":{"assert-plus":"^0.1.5","lodash":"^3.10.1"},"gitHead":"60ba1cedfed1b165c8e7fbced31ee4f00f0273b9","bugs":{"url":"https://github.com/ukayani/restify-router/issues"},"homepage":"https://github.com/ukayani/restify-router#readme","_id":"restify-router@0.3.0","_shasum":"d70ced85901f9535b5d5c36a1d48b89f94303ede","_from":".","_npmVersion":"3.8.9","_nodeVersion":"6.2.0","_npmUser":{"name":"kayaniu","email":"kayani.u@gmail.com"},"dist":{"shasum":"d70ced85901f9535b5d5c36a1d48b89f94303ede","tarball":"https://registry.npmjs.org/restify-router/-/restify-router-0.3.0.tgz","integrity":"sha512-GHMUifpkTQkMlIaC6DJPZIdo5uziQs0V3WAAboQmuYW6cVnQ/QBmk8LfkPVftzzs4I9GjQTs+nn5wOUrm5lsNA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDYIsPmWQNFbuxy0Llky7ORozMrHGUadNq0y3PeZ+8cSAiEAhO8BPu7FJqyexYifuP8xVynpHqmydUno0uHVRutl0IA="}]},"maintainers":[{"name":"kayaniu","email":"kayani.u@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/restify-router-0.3.0.tgz_1482604837524_0.9240229709539562"},"directories":{}},"0.3.1":{"name":"restify-router","version":"0.3.1","description":"A router interface for restify that lets you aggregate route definitions and apply to a restify server","main":"index.js","repository":{"type":"git","url":"git+https://github.com/ukayani/restify-router.git"},"scripts":{"test":"mocha"},"keywords":["restify","router"],"author":{"name":"ukayani"},"license":"ISC","devDependencies":{"chai":"^3.3.0","gulp":"^3.9.0","gulp-istanbul":"^0.10.0","gulp-jscs":"^3.0.0","gulp-jshint":"^1.11.2","gulp-jshint-html-reporter":"^0.1.3","gulp-mocha":"^2.1.3","gulp-util":"^3.0.6","jscs-stylish":"^0.3.1","jshint-stylish":"^2.0.1","mocha":"^2.3.3","sinon":"^1.17.0","supertest":"^1.1.0","restify":"^4.0.3"},"dependencies":{"assert-plus":"^0.1.5","lodash":"^3.10.1"},"gitHead":"b7c3c561684d882d970dd35f60901a5623dd3805","bugs":{"url":"https://github.com/ukayani/restify-router/issues"},"homepage":"https://github.com/ukayani/restify-router#readme","_id":"restify-router@0.3.1","_shasum":"9f963767878bc6831022e62124376ce17cc00ca9","_from":".","_npmVersion":"3.10.9","_nodeVersion":"6.9.2","_npmUser":{"name":"kayaniu","email":"kayani.u@gmail.com"},"dist":{"shasum":"9f963767878bc6831022e62124376ce17cc00ca9","tarball":"https://registry.npmjs.org/restify-router/-/restify-router-0.3.1.tgz","integrity":"sha512-8S6vb2L2VjRRfzjOMkzjfIvTVozTqn4auUM5oK8EzA7vs5MXR86w6CrLNv04nYrQLsOCmVM3KR2Hhe9DuvGSYw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICOqzl1rSsdUlxZHexnu2G8L9yaDJOTERySI1ToGmxsPAiEA+D6L/K7wgGEO37nOJF5STcea868lz9hOs0gD4FWYrHM="}]},"maintainers":[{"name":"kayaniu","email":"kayani.u@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/restify-router-0.3.1.tgz_1483041436172_0.3376419742126018"},"directories":{}},"0.4.0":{"name":"restify-router","version":"0.4.0","description":"A router interface for restify that lets you aggregate route definitions and apply to a restify server","main":"index.js","repository":{"type":"git","url":"git+https://github.com/ukayani/restify-router.git"},"scripts":{"test":"mocha"},"keywords":["restify","router"],"author":{"name":"ukayani"},"license":"ISC","devDependencies":{"chai":"^3.3.0","gulp":"^3.9.0","gulp-istanbul":"^0.10.0","gulp-jscs":"^3.0.0","gulp-jshint":"^1.11.2","gulp-jshint-html-reporter":"^0.1.3","gulp-mocha":"^2.1.3","gulp-util":"^3.0.6","jscs-stylish":"^0.3.1","jshint-stylish":"^2.0.1","mocha":"^2.3.3","sinon":"^1.17.0","supertest":"^1.1.0","restify":"^4.0.3"},"dependencies":{"assert-plus":"^0.1.5","lodash":"^3.10.1"},"gitHead":"d1a1de98155f950a7c944a40e3fda0ce11845398","bugs":{"url":"https://github.com/ukayani/restify-router/issues"},"homepage":"https://github.com/ukayani/restify-router#readme","_id":"restify-router@0.4.0","_shasum":"000a7cb3ec29e186c58ea3c692c66868dc5abb3e","_from":".","_npmVersion":"3.10.9","_nodeVersion":"6.9.2","_npmUser":{"name":"kayaniu","email":"kayani.u@gmail.com"},"dist":{"shasum":"000a7cb3ec29e186c58ea3c692c66868dc5abb3e","tarball":"https://registry.npmjs.org/restify-router/-/restify-router-0.4.0.tgz","integrity":"sha512-qD07Cmaaf2/ppmVinxs10r1XmrVaTf0YHzt7gyNIK/+tYKKmszupsKyLiC6awDuhqFEqIjQD0+lg/5M7DpYfFA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCta/BwGeSqXzQxLFsGMuAw4Pjbh1RAZeVX1UxVXyahuQIhANTGJdarZ2qsrwHjKza9ZHysBibGLuHuIOBNxKDxGgmK"}]},"maintainers":[{"name":"kayaniu","email":"kayani.u@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/restify-router-0.4.0.tgz_1484839437586_0.9472492258064449"},"directories":{}},"0.4.1":{"name":"restify-router","version":"0.4.1","description":"A router interface for restify that lets you aggregate route definitions and apply to a restify server","main":"index.js","repository":{"type":"git","url":"git+https://github.com/ukayani/restify-router.git"},"scripts":{"test":"mocha"},"keywords":["restify","router"],"author":{"name":"ukayani"},"license":"ISC","devDependencies":{"chai":"^3.3.0","gulp":"^3.9.0","gulp-istanbul":"^0.10.0","gulp-jscs":"^3.0.0","gulp-jshint":"^1.11.2","gulp-jshint-html-reporter":"^0.1.3","gulp-mocha":"^2.1.3","gulp-util":"^3.0.6","jscs-stylish":"^0.3.1","jshint-stylish":"^2.0.1","mocha":"^2.3.3","sinon":"^1.17.0","supertest":"^1.1.0","restify":"^4.0.3"},"dependencies":{"assert-plus":"^0.1.5"},"gitHead":"493be0f15d4064f20bafe622f31c4335c35043fd","bugs":{"url":"https://github.com/ukayani/restify-router/issues"},"homepage":"https://github.com/ukayani/restify-router#readme","_id":"restify-router@0.4.1","_shasum":"841080558505e452e9d30a1364a52a8251ffae95","_from":".","_npmVersion":"3.10.9","_nodeVersion":"6.9.2","_npmUser":{"name":"kayaniu","email":"kayani.u@gmail.com"},"dist":{"shasum":"841080558505e452e9d30a1364a52a8251ffae95","tarball":"https://registry.npmjs.org/restify-router/-/restify-router-0.4.1.tgz","integrity":"sha512-F3hlkM7AuZECXm1AJREszyCaymPAU/+5IvaOpPnqMp55Fe3QDEWAeaLuvtwacqzeilCAFQFBf9rtN/X4vdpy1g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCn7Sx9KURGXaMWZo5vwNNVM9qWdBODXws7tKbjzbPxYAIhAI4JGrnHa8DELfuBc9nakQiNIM+Jn5f8P8ecU7Z4qPg0"}]},"maintainers":[{"name":"kayaniu","email":"kayani.u@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/restify-router-0.4.1.tgz_1485481747082_0.03020982234738767"},"directories":{}},"0.4.2":{"name":"restify-router","version":"0.4.2","description":"A router interface for restify that lets you aggregate route definitions and apply to a restify server","main":"index.js","repository":{"type":"git","url":"git+https://github.com/ukayani/restify-router.git"},"scripts":{"test":"mocha"},"keywords":["restify","router"],"author":{"name":"ukayani"},"license":"ISC","devDependencies":{"chai":"^3.3.0","gulp":"^3.9.0","gulp-istanbul":"^0.10.0","gulp-jscs":"^3.0.0","gulp-jshint":"^1.11.2","gulp-jshint-html-reporter":"^0.1.3","gulp-mocha":"^2.1.3","gulp-util":"^3.0.6","jscs-stylish":"^0.3.1","jshint-stylish":"^2.0.1","mocha":"^2.3.3","sinon":"^1.17.0","supertest":"^1.1.0","restify":"^4.0.3"},"dependencies":{"assert-plus":"^0.1.5"},"gitHead":"8eb89d6b8fed2971222cde2bd779edfe886525f8","bugs":{"url":"https://github.com/ukayani/restify-router/issues"},"homepage":"https://github.com/ukayani/restify-router#readme","_id":"restify-router@0.4.2","_shasum":"966f9475e52e5dc11573bb21f9251532bbc34e5f","_from":".","_npmVersion":"4.0.5","_nodeVersion":"7.4.0","_npmUser":{"name":"kayaniu","email":"kayani.u@gmail.com"},"dist":{"shasum":"966f9475e52e5dc11573bb21f9251532bbc34e5f","tarball":"https://registry.npmjs.org/restify-router/-/restify-router-0.4.2.tgz","integrity":"sha512-odR6wM1PAGU3oPhhaSg1BKzLCclpfZTjSMT9Gx5R4Nkh6DKw2jEuk8nIc04qbLUZt8bf7teLJxe43UaS0EtZKw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGFUDwpdUPvndfqNj1qHG9jbfcMSBs1abC+cd2vt7Ir1AiEAgGlq1tKkejEURiVRKhPJ7FCCMqw0w5s6RmtAGt4QEUo="}]},"maintainers":[{"name":"kayaniu","email":"kayani.u@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/restify-router-0.4.2.tgz_1488518544241_0.686758155701682"},"directories":{}},"0.5.0":{"name":"restify-router","version":"0.5.0","description":"A router interface for restify that lets you aggregate route definitions and apply to a restify server","main":"index.js","repository":{"type":"git","url":"git+https://github.com/ukayani/restify-router.git"},"scripts":{"test":"mocha"},"keywords":["restify","router"],"author":{"name":"ukayani"},"license":"ISC","devDependencies":{"chai":"^3.3.0","gulp":"^3.9.0","gulp-istanbul":"^0.10.0","gulp-jscs":"^3.0.0","gulp-jshint":"^1.11.2","gulp-jshint-html-reporter":"^0.1.3","gulp-mocha":"^2.1.3","gulp-util":"^3.0.6","jscs-stylish":"^0.3.1","jshint-stylish":"^2.0.1","mocha":"^2.3.3","sinon":"^1.17.0","supertest":"^1.1.0","restify":"^4.0.3"},"dependencies":{"assert-plus":"^0.1.5"},"gitHead":"bb1bfefd16f6d92ec89b868b1a4712e11b1ac293","bugs":{"url":"https://github.com/ukayani/restify-router/issues"},"homepage":"https://github.com/ukayani/restify-router#readme","_id":"restify-router@0.5.0","_shasum":"cd6ec30d97ea5db942d7c31984d8cf72eb2ebe29","_from":".","_npmVersion":"3.10.9","_nodeVersion":"6.9.2","_npmUser":{"name":"kayaniu","email":"kayani.u@gmail.com"},"dist":{"shasum":"cd6ec30d97ea5db942d7c31984d8cf72eb2ebe29","tarball":"https://registry.npmjs.org/restify-router/-/restify-router-0.5.0.tgz","integrity":"sha512-+qo4YNR9XS478GGbdkUIu17YwnNhil5D6ofmq4JtnK4Gkn/d2LvSJzfxbI1eogFJLgKSA2igftOvCfnEOkozxg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHm52mJ6YqFY4KtAMfw/MBDO2gqy7G43NqQ6xkN2d8JGAiEAnyxpWMlx3+3AsAdrJjU+/6JGk7wrOpIotaq6hp7k99o="}]},"maintainers":[{"name":"kayaniu","email":"kayani.u@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/restify-router-0.5.0.tgz_1509051096187_0.6072319389786571"},"directories":{}},"0.5.1":{"name":"restify-router","version":"0.5.1","description":"A router interface for restify that lets you aggregate route definitions and apply to a restify server","main":"index.js","repository":{"type":"git","url":"git+https://github.com/ukayani/restify-router.git"},"scripts":{"test":"mocha"},"keywords":["restify","router"],"author":{"name":"ukayani"},"license":"ISC","devDependencies":{"@types/restify":"^7.2.5","chai":"^3.3.0","gulp":"^4.0.0","gulp-istanbul":"^1.1.3","gulp-jscs":"^4.1.0","gulp-jshint":"^2.1.0","gulp-jshint-html-reporter":"^0.1.3","gulp-mocha":"^6.0.0","gulp-util":"^3.0.6","jscs-stylish":"^0.3.1","jshint-stylish":"^2.0.1","mocha":"^5.2.0","restify":"^4.0.3","sinon":"^1.17.0","supertest":"^3.3.0"},"dependencies":{"assert-plus":"^0.1.5"},"types":"./types/restify-router/index.d.ts","gitHead":"07c68e49927e5f23f1cabcfeea7257b681caac66","bugs":{"url":"https://github.com/ukayani/restify-router/issues"},"homepage":"https://github.com/ukayani/restify-router#readme","_id":"restify-router@0.5.1","_npmVersion":"6.4.1","_nodeVersion":"8.11.3","_npmUser":{"name":"kayaniu","email":"kayani.u@gmail.com"},"dist":{"integrity":"sha512-DBv4Bxl/MCYgv6KQ2FIfeBo/tetNPM6xdFOY80muJ/VvIgyUdnho2tcU87SXLJXP/Q9Ahf5vKED93+em7lfCBQ==","shasum":"136bc92285c54911b1123ac13956c0b1d59d25da","tarball":"https://registry.npmjs.org/restify-router/-/restify-router-0.5.1.tgz","fileCount":11,"unpackedSize":19366,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbyOU7CRA9TVsSAnZWagAA2dEP/1CcOD+7F8hTUxCUfKtS\nnh7/ARk2LB8FGt8K8JBf+lMZ7SYi9YoaPe0yF1zQPLw4VdGIqu+1ZOOy2D3x\nTb6Y4RBBN7gJ8lI4x63ti1SOMV3evmfIdcKE8c53TyTtfG+fkGgTUh+BxNv5\nGGMK1YSfvF3wqPc2eyDlLG8kWxw2XwlvaSusa7ZZXrB9iYDj18fY3DQvu8p5\nXk51DssU22fuCVuSxSZ6jDzpXcua0Ks4iiJsp29QKJEhX0uSMUD215tp+yB8\nyQ0RioXB2k/YZgoDNw0H2B2lVrJ7whZ6QgCOgAkAkNueYzlC3FNFNBFtzjd5\nw0BT1O9TndUEE0wodk0SqqpbHjDKfCx3X2Qx68R2+ayH8n/ZEdEdrRhLy0g2\n5R/s0r70RT8ESQ6/JV4CQ+Pq3geG50S9mT9C7t5PNQi41DAUMLaqZQhVM0bm\np82Msho5eEkM1+s62Aoo5/PU5SfRM7tQaZAYQidppGucbJSuwYbxwRf+FPI6\n7kq4UkU2dPryYwuysshPIXNVbBRR09sZ2eLgDBREhSYEsz5PCwpCPPavLkAv\n75z1GneJaCfpXyXCAI93u9+VcjSXpYunSigleugOqgWBzvuahFZ+9NKrkQ5+\nJczgkGYlBD0JoS4wP8ekMrQtOnraL1zDeF2tvYZzuIHqXf4bKpHoI7ekYPHm\nhyj5\r\n=X/Fb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDiDyyX88t4K1W+qPyF+9oM9CEm9s/2tXtgzlM5rv3jCgIgOYUcfnuSJhEGvHBTdoMiDvh6Bg/i7V+rvkE96FDDgwI="}]},"maintainers":[{"name":"kayaniu","email":"kayani.u@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/restify-router_0.5.1_1539892538486_0.5365091654991163"},"_hasShrinkwrap":false},"0.6.0":{"name":"restify-router","version":"0.6.0","description":"A router interface for restify that lets you aggregate route definitions and apply to a restify server","main":"index.js","engines":{"node":">=8.0.0"},"repository":{"type":"git","url":"git+https://github.com/ukayani/restify-router.git"},"scripts":{"test":"c8 mocha && c8 check-coverage --lines 95","clean":"rm -rf coverage","lint":"eslint 'lib/*.js'","fix":"eslint --fix 'lib/*.js'"},"keywords":["restify","router"],"author":{"name":"ukayani"},"license":"ISC","devDependencies":{"@types/restify":"^7.2.12","eslint":"^6.0.0","chai":"^3.3.0","c8":"^7.2.0","mocha":"^5.2.0","restify":"^4.0.3","sinon":"^1.17.0","supertest":"^3.3.0"},"dependencies":{"assert-plus":"^0.1.5"},"types":"./types/restify-router/index.d.ts","gitHead":"76acccbacd377a001f960d62d60f88a7771159dd","bugs":{"url":"https://github.com/ukayani/restify-router/issues"},"homepage":"https://github.com/ukayani/restify-router#readme","_id":"restify-router@0.6.0","_nodeVersion":"12.18.1","_npmVersion":"6.14.5","dist":{"integrity":"sha512-1qhRYGTHE6iz0nGZImkJZahGIRm7nWIStQx6uZPaNmS7rhTfUal1JseBlj1BAnJciTcFlIJe5zRRvlX7V6KJuw==","shasum":"d074fa3fc244c7003275f28703043ed0425256e0","tarball":"https://registry.npmjs.org/restify-router/-/restify-router-0.6.0.tgz","fileCount":15,"unpackedSize":26713,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfCLvbCRA9TVsSAnZWagAAx2QP/0WHlkOjPUaLHI0RBEvP\nspS7Un3f5IxVjtcQGJPcrMFt9t9Q/NPz+QU7D/Mn3mqM0GX+bxANjTpT+XN6\nZF7zfUr8fo9nWB/dv5A9q8gZ3B9pBctFGL4t57QQ0y+z4HBiI9EA9TRu/sxA\nV6E99dER/2BPKbIMcYwZOwo3rH3O8LuZJjWroaMu+Ytqfy3MClcVz5hhmZSq\n8Irbs59gDtEWLoLobxjJc48Fhn4KoipceMGA516ZM7mzp9dCf2VE9e5GuUNO\nKcOtrHc0P+qGp9q4lak0bgORQOi1LzE3KWHtl8tdJ5LGhGXNsSz9NP3e92oH\ndfxgR4wjLsk71dkUdTmsjzChqaPYtOm3Tu4+GWHTGoYBeWLZxDBCoT89vDd6\nb0/4XZWqTH+pK23oIB7OvOBX5Gt/2Reo5ydnkweCcSEif0IlAV4eHIg6arRi\n3BQ+SX9WinydM2JGtF4qHi5f9gTg0dEE1SxxQuFdhnBlJORFEvjV9C/z2EkS\nmD7ue0exo+u680bKZn2lJ1pZkf8g0gp1TL7330yVbh8wigu6tUlkSGLvx3VQ\nUP3KY3e0f2wxq8otSn6vg02qNwV5T4CZ/FLiv0YkRogZqns+jAY/ehgeVV1V\nv/PVxLgKIHys0S+hdEGTrisb3xc3SEZsdTMoLDd7UpRuU8N0qCqHtu89m4bM\nTzP+\r\n=2KSr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjfIf0ysyUaerbC6DA+EjyT8LnuUNmHN27E/s99BvV/wIhAPqz+hTITwMYQhQbPfSTD1YY4rS75BPvLB5xzna8GTaI"}]},"maintainers":[{"email":"saltan23@gmail.com","name":"kayaniu"},{"email":"kayani.u@gmail.com","name":"ukayani"}],"_npmUser":{"name":"ukayani","email":"kayani.u@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/restify-router_0.6.0_1594407898539_0.2433916657837909"},"_hasShrinkwrap":false},"0.6.1":{"name":"restify-router","version":"0.6.1","description":"A router interface for restify that lets you aggregate route definitions and apply to a restify server","main":"index.js","engines":{"node":">=8.0.0"},"repository":{"type":"git","url":"git+https://github.com/ukayani/restify-router.git"},"scripts":{"test":"c8 mocha && c8 check-coverage --lines 95","clean":"rm -rf coverage","lint":"eslint 'lib/*.js'","fix":"eslint --fix 'lib/*.js'"},"keywords":["restify","router"],"author":{"name":"ukayani"},"license":"ISC","devDependencies":{"@types/restify":"^7.2.12","eslint":"^6.0.0","chai":"^3.3.0","c8":"^7.2.0","mocha":"^5.2.0","restify":"^4.0.3","sinon":"^1.17.0","supertest":"^3.3.0"},"dependencies":{"assert-plus":"^0.1.5"},"types":"./types/restify-router/index.d.ts","gitHead":"9693d0f2ab7dd28bb206d6039c4b745b572c27af","bugs":{"url":"https://github.com/ukayani/restify-router/issues"},"homepage":"https://github.com/ukayani/restify-router#readme","_id":"restify-router@0.6.1","_nodeVersion":"12.18.2","_npmVersion":"6.14.5","dist":{"integrity":"sha512-XRqyljhZFV4AXV5MLlrdoJre0xUwpw9FBv0ZbKMVkeCPEqyn4nsa848u/hjSqS7nULf8KjtcGhlS2+05k0K5AA==","shasum":"f199df43f2c9dc0dafac8f0f2aaf72967915626d","tarball":"https://registry.npmjs.org/restify-router/-/restify-router-0.6.1.tgz","fileCount":15,"unpackedSize":29559,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEH2ZCRA9TVsSAnZWagAA3HkP/Rssyjj1cDG6BV/7qnCc\n5gQyRf6Zs3Yp77IWHiuYYcjFHWAck8SzGGOWX/PIqGskxBWe6GvkbAISzfTs\njZjup7YsVyoeh39jW3/GwKDHtueRjSKOPbCF1f+30we+lxB2hVHzz7PuoZ4B\nm+wBPANoqyMxuj8l+CbUSqj3PsfbIRSU38neJMMc9vwrV1RUAsIobk4vVzx/\nv7yL6A4TpvbS+Vtvpuaau5BXpFRRJLCQ5ZjflMZ7oiqmj9sOFXIdEGd0RILB\nE4eShWmPNPhfL/LMUiJIOjbbNAQQq+O+Npm7kZsJF+eqnwITI6V66pMcfJGs\nWzgkAE5lbLFDHjQo1mvejH2I1gkfD8BSFau+F/4ZHB9/5MteDvYa7KAexMSa\nRgpQr+cayIq8n20EiMWETkmGxxFw8lKqIhI3dnx2hqgkJZgvYkc4jNi+KIOv\nfZd8cxbwDU0lfRxxCD1jGgbMVn/6iLIktCBfxMuZlij90k89C8HrdZLam5JI\nQHlZqnNlfTQBqf4YHN+wuyqzt13NbZQXcA9IGitfmUfm/oXjvM+54MAKGA+d\nxWLlqP2dSNadbMtFRWfI9tHdwsz0ZVAYPtaZKdkvdKr8+1thuhtvJ1YufynR\nCMr1DHJfz45M1aE6LV0KzlupL/WwlkdaSGRF20L3pMaQ5Bm3qIbYUyyjb2Hk\nUUUI\r\n=4sFh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCMT8bSYkVEy8aoYfRM3qZN3xxGhedG+TZ7vY3ZL+ckcQIhANRbCa1aNN+zEx9sAq4AIiznoeniRpyZQEXmSRsCuVx3"}]},"maintainers":[{"email":"saltan23@gmail.com","name":"kayaniu"},{"email":"kayani.u@gmail.com","name":"ukayani"}],"_npmUser":{"name":"ukayani","email":"kayani.u@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/restify-router_0.6.1_1594916249217_0.3790659450887768"},"_hasShrinkwrap":false},"0.6.2":{"name":"restify-router","version":"0.6.2","description":"A router interface for restify that lets you aggregate route definitions and apply to a restify server","main":"index.js","engines":{"node":">=8.0.0"},"repository":{"type":"git","url":"git+https://github.com/ukayani/restify-router.git"},"scripts":{"test":"c8 mocha && c8 check-coverage --lines 95","clean":"rm -rf coverage","lint":"eslint 'lib/*.js'","fix":"eslint --fix 'lib/*.js'"},"keywords":["restify","router"],"author":{"name":"ukayani"},"license":"ISC","devDependencies":{"@types/restify":"^7.2.12","eslint":"^6.0.0","chai":"^3.3.0","c8":"^7.2.0","mocha":"^5.2.0","restify":"^4.0.3","sinon":"^1.17.0","supertest":"^3.3.0"},"dependencies":{"assert-plus":"^0.1.5"},"types":"./types/restify-router/index.d.ts","gitHead":"11c74543453785663c5f440c5d4c1f6f6d21b595","bugs":{"url":"https://github.com/ukayani/restify-router/issues"},"homepage":"https://github.com/ukayani/restify-router#readme","_id":"restify-router@0.6.2","_nodeVersion":"12.18.4","_npmVersion":"6.14.6","dist":{"integrity":"sha512-GjGoem5KIwL57WGoSV0SnoF3e5ZAdDOQA8YxuyvzvWxLTwrrsg6Obtxi5F400IE8pg0lVqC9Rv37omezdPgq8Q==","shasum":"b8030135399c4fed1a680ff851abf5fc37198e7c","tarball":"https://registry.npmjs.org/restify-router/-/restify-router-0.6.2.tgz","fileCount":15,"unpackedSize":29698,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdfvPCRA9TVsSAnZWagAAzfkQAKJilXf9TkYHaFpTTpv0\nxlktL8WjzVvQRSNwQUVK4/nmlhZwuzZNgW+jjj/hq3tVhNZbugQsm245q+1b\nnKe+T0czPKJ/7Q2FfXiSXjSmCRZAIGM4LnMoplN9R/rUEuasX5f6fE2BAljQ\nRkLFmfU9FUhHgl3Xs3YMLfVXOWTcoxzca32MKn9LL/g+pPbs83+GhELU2KGl\nrIkAU95deGlobGA96U13upOxZpo/kY4Qs/cIElsZ6MxbucSnc4Axhh1DXoT2\nYKVGQ33FyVGALBSuVOsk9gk2cRbM4CQGj2+o9YYG5v4A5tDnjvAb8uL/ARBQ\nKh+vvCNFVwJEikLoef33+wpGcMDpaTZXcSzU3TyGMKeIdQM006WAX/+8xoid\nUnrrGfjAQF3twcfW/g0/JGkUkPsBBsQvZaATtu6lGZa/qLihLrOKXlcMvgQp\nxAqioqRWgffsiMfiR0UDcFMegnQOCVjmx8Q2OeWbvS01hJqXDbmq4olf5L1I\neAZG8yZe5L1lYNxJ9iNQzvkbRxd5L6t9KI2xK3VTuIyFNUR9NLCvZZVBp+wy\nX++zG7yWAz3Fk7rECAPfoQXhtPqAEJegLy6mHGOexRf554UF5XaPq8MU44v9\nzN5c68JKkZHxCHAPp7v6zVpDYK2JdrHuMofIXqZGk7SDcs2T8sgy+3RrNVFa\ngZII\r\n=0xgy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCjQyFMpliL52L5kq/t+8LniVKRGpM5hDGmlU5ilRVVUwIgYu5lWZeh1if5dFThreQzfo2r0kNKgVshx0qRLHYl3p0="}]},"maintainers":[{"name":"kayaniu","email":"saltan23@gmail.com"},{"name":"ukayani","email":"kayani.u@gmail.com"}],"_npmUser":{"name":"ukayani","email":"kayani.u@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/restify-router_0.6.2_1601567694456_0.5880117272780263"},"_hasShrinkwrap":false}},"readme":"# Restify Router\n\n![Build Status](https://github.com/ukayani/restify-router/workflows/Build/badge.svg?branch=master)\n\nThis module allows you to define your routes using a Router interface that is identical to how routes are registered\non a restify server. You can then apply the routes to a server instance.\n\nBorrowing from the idea of Express router where you can organize routes by creating multiple routers and applying them\nto an express server, this component allows you to achieve a similar separation/grouping of route definitions.\n\n## Summary\n- [Installation](#installation)\n  - [Creating a router](#creating-a-router)\n  - [Why use it?](#why-use-it)\n- [Prefixing Routes](#prefixing-routes)\n- [Nesting Routers](#nesting-routers)\n  - [Example Usage](#example-usage)\n- [Grouping Routers](#grouping-routers)\n  - [Example Usage](#basic-usage)\n  - [Example Usage with middleware](#basic-usage-with-nesting-middlewares)\n- [Common Middleware](#common-middleware)\n\n# Installation\n\n```bash\n$ npm install --save restify-router\n```\n\n## Creating a router\n\nA router object is an isolated instance of routes. The router interface matches the interface for adding routes to a\nrestify server:\n\n```javascript\nvar Router = require('restify-router').Router;\nvar routerInstance = new  Router();\nvar restify = require('restify');\n\nfunction respond(req, res, next) {\n  res.send('hello ' + req.params.name);\n  next();\n}\n\n// add a route like you would on a restify server instance\nrouterInstance.get('/hello/:name', respond);\n\nvar server = restify.createServer();\n// add all routes registered in the router to this server instance\nrouterInstance.applyRoutes(server);\n\nserver.listen(8080, function() {\n  console.log('%s listening at %s', server.name, server.url);\n});\n```\n\n## Why use it?\n\nWhen your application starts to contain a lot of routes, you may want to group the definition of routes in\nseparate files rather than registering every route in a single server bootstrap/creation file.\n\nFor example, if we have two sets of routes in our application:\n\nUsers:\n\n- GET `/users`\n- GET `/users/:id`\n\nPosts:\n\n- GET `/posts`\n- GET `/posts/:id`\n\n```javascript\nvar userRouter = require('./user.router'); // return a Router with only user route definitions\nvar postsRouter = require('./posts.router'); // return a Router with only posts route definitions\n\nvar restify = require('restify');\nvar server = restify.createServer();\n\n// add user routes\nuserRouter.applyRoutes(server);\n\n// add posts routes\npostsRouter.applyRoutes(server);\n\nserver.listen(8080, function() {\n  console.log('%s listening at %s', server.name, server.url);\n});\n```\n\n# Prefixing Routes\n\nTo prefix all routes, specify the prefix as the second argument to `router.applyRoutes(server, prefix)`\n\n- `prefix` must be a string or a regex\n\nExample:\n\nRoutes:\n\n- GET `/admin/settings`\n- GET `/admin/controls`\n\n\n```javascript\nvar Router = require('restify-router').Router;\nvar restify = require('restify');\n\nfunction settings(req, res, next) {\n  res.send('settings');\n  next();\n}\n\nfunction controls(req, res, next) {\n  res.send('controls');\n  next();\n}\n\nvar routerInstance = new Router();\n\n// add a route like you would on a restify server instance\nrouterInstance.get('/settings', settings);\nrouterInstance.get('/controls', controls);\n\nvar server = restify.createServer();\n// add all routes registered in the router to this server instance with uri prefix 'admin'\nrouterInstance.applyRoutes(server, '/admin');\n\nserver.listen(8080, function() {\n  console.log('%s listening at %s', server.name, server.url);\n});\n\n```\n\n# Nesting Routers\n\nIf you are familiar with Express style routers, you have the ability to nest routers under\nother routers to create a hierarchy of route definitions.\n\nTo nest routers use the `.add` method on a Router:\n\n```javascript\nrouter.add(path, router);\n```\n\n- path - a string or regexp path beginning with a forward slash (/)\n    - All routes defined in the provided router will be prefixed with this path during registration\n- router - the router instance to nest\n\n## Example Usage\n\n```javascript\n// routes/v1/auth.js\n\nconst router = new Router();\nrouter.post(\"/register\", function (req, res, next) {\n // do something with req.body\n res.send({status: 'success'});\n return next();\n});\n\nmodule.exports = router;\n```\n\n```javascript\n// routes/v1/routes.js\n\nconst router = new Router();\nrouter.add(\"/auth\", require(\"./auth\"));\n\nmodule.exports = router;\n```\n\n```javascript\n// routes/routes.js\n\nconst router = new Router();\nrouter.add(\"/v1\", require(\"./v1/routes\"));\n\nmodule.exports = router;\n```\n\nWith the above router definition from `routes/routes.js` we can do the following call:\n\n`POST /v1/auth/register`\n\nThis call is possible because we have nested routers two levels deep from the `/v1` path.\n\n\n# Grouping Routers\n\nAs an alternative to Nesting Routers, you can use the group to clarify the middlewares manipulation and the routes / files organization.\nWorks in a way that does not need to create multiple instances of the Router like Nesting.\n\nTo group routers use the `.group` method on a Router:\n\n```javascript\nrouter.group(path, callback);\n```\n\n## Example Usage\n\n### Basic Usage\n\n```javascript\nvar Router = require('restify-router').Router;\nvar restify = require('restify');\n\nvar routerInstance = new  Router();\nvar server = restify.createServer();\n\nrouterInstance.get('/', function (req, res, next) {\n  res.send({message: 'home'});\n  return next();\n});\n\nrouterInstance.group('/v1', function (router) {\n  router.get('/', function (req, res, next) {\n    res.send({message: 'home V1'});\n    return next();\n  });\n\n  router.group('/auth', function (router) {\n    router.post('/register', function (req, res, next) {\n      res.send({message: 'success (v1)'});\n      return next();\n    });\n  });\n});\n\nrouterInstance.group('/v2', function (router) {\n  router.get('/', function (req, res, next) {\n    res.send({message: 'home V2'});\n    return next();\n  });\n});\n\n// add all routes registered in the router to this server instance\nrouterInstance.applyRoutes(server);\n\nserver.listen(8081, function() {\n  console.log('%s listening at %s', server.name, server.url);\n});\n```\n\nWith the above code definition we can do the following calls:\n\n- GET `/`\n- GET `/v1`\n- POST `/v1/auth/register`\n- GET `/v2`\n\n### Basic Usage with nesting Middlewares\n\n```javascript\nvar Router = require('restify-router').Router;\nvar restify = require('restify');\n\nvar routerInstance = new  Router();\nvar server = restify.createServer();\n\nfunction midFirst(req, res, next) { /**/ }\nfunction midSecond(req, res, next) { /**/ }\nfunction midThird(req, res, next) { /**/ }\n\nrouterInstance.group('/v1', midFirst, function (router) {\n  router.get('/', function (req, res, next) {\n    res.send({message: 'home V1'});\n    return next();\n  });\n\n  router.group('/auth', midSecond, function (router) {\n    router.post('/register', midThird, function (req, res, next) {\n      res.send({message: 'success (v1)'});\n      return next();\n    });\n  });\n});\n\n// add all routes registered in the router to this server instance\nrouterInstance.applyRoutes(server);\n\nserver.listen(8081, function() {\n  console.log('%s listening at %s', server.name, server.url);\n});\n```\n\nWith the above code definition we can do the following calls:\n\n- GET `/v1 [midFirst]`\n- POST `/v1/auth/register [midFirst, midSecond, midThird]`\n\n# Common Middleware\n\nThere may be times when you want to apply some common middleware to all routes registered with a router.\nFor example, you may want some common authorization middleware for all routes under a specific router.\n\nAll middleware registered via `.use` will be applied before route level middleware.\n\nTo stay consistent with the `restify` server interface, the method on the Router is:\n\n- `.use(middlewareFn, middlewareFn2, ...)`\n- `.use([middlewareFn, middlewareFn2, ...])`\n\n**Note**: Multiple calls to `.use` will result in aggregation of middleware, each successive call will append to the list of common middleware\n\n## Example Usage\n\n```javascript\nvar router = new Router();\n\n// this will run before every route on this router\nrouter.use(function (req, res, next) {\n   if (req.query.role === 'admin') {\n    return next();\n   } else {\n    return next(new errors.UnauthorizedError());\n   }\n});\n\nrouter.get('/hello', function (req, res, next) {\n   res.send('Hello');\n   next();\n});\n\nrouter.get('/test', function (req, res, next) {\n   res.send('Test');\n   next();\n});\n\nrouter.applyRoutes(server);\n\n// calling GET /hello  runs use middle ware first and then the routes middleware\n\n```\n\n# Links\n\nFor more information about Restify Router see [Organizing Restify Routes with Restify Router](http://recursivethoughts.com/organizing-restify-routes-with-restify-router/)\n","maintainers":[{"name":"kayaniu","email":"saltan23@gmail.com"},{"name":"ukayani","email":"kayani.u@gmail.com"}],"time":{"modified":"2022-06-26T12:10:06.782Z","created":"2015-09-28T13:54:11.851Z","0.1.0":"2015-09-28T13:54:11.851Z","0.1.1":"2015-09-28T14:03:18.779Z","0.1.2":"2015-09-28T14:25:29.599Z","0.1.3":"2015-09-28T15:54:53.814Z","0.2.0":"2015-11-01T23:13:03.465Z","0.2.1":"2015-11-01T23:32:52.733Z","0.3.0":"2016-12-24T18:40:37.757Z","0.3.1":"2016-12-29T19:57:16.404Z","0.4.0":"2017-01-19T15:23:57.824Z","0.4.1":"2017-01-27T01:49:07.294Z","0.4.2":"2017-03-03T05:22:26.036Z","0.5.0":"2017-10-26T20:51:37.069Z","0.5.1":"2018-10-18T19:55:38.620Z","0.6.0":"2020-07-10T19:04:58.670Z","0.6.1":"2020-07-16T16:17:29.391Z","0.6.2":"2020-10-01T15:54:54.581Z"},"keywords":["restify","router"],"license":"ISC","readmeFilename":"README.md","homepage":"https://github.com/ukayani/restify-router#readme","repository":{"type":"git","url":"git+https://github.com/ukayani/restify-router.git"},"author":{"name":"ukayani"},"bugs":{"url":"https://github.com/ukayani/restify-router/issues"},"users":{"arvindrsingh":true,"dingyuanwu":true,"vparaskevas":true}}