Namespace your restify routes
Defining sub-routes is something that happens often. Why keep repeating yourself?
restify-namespace makes it easy to define nested route prefixes to DRY up your routes.
npm install --save restify-namespace
Here is how you might define some routes:
var namespace = require'restify-namespace';var app = restifycreateServer;namespaceapp '/api'appget'/thingys' thingysHandler;namespaceapp '/beep'appget'/boop' plunkHandler;;;
This would create the following routes:
GET /api/thingys GET /api/beep/boop
At the moment
restify-namespace does not support regular expression subroutes. It will throw to warn you of this.