New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

restify-namespace

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

restify-namespace

Namespace your restify routes

latest
Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
10
66.67%
Maintainers
1
Weekly downloads
 
Created
Source

restify-namespace - simple route namespacing

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.

Installation

npm install --save restify-namespace

Example

Here is how you might define some routes:

var namespace = require('restify-namespace');
var app = restify.createServer();
namespace(app, '/api', function () {
	app.get('/thingys', thingysHandler);

	namespace(app, '/beep', function () {
		app.get('/boop', plunkHandler);
	});
});

This would create the following routes:

GET /api/thingys
GET /api/beep/boop

Not Implemented

At the moment restify-namespace does not support regular expression subroutes. It will throw to warn you of this.

Keywords

restify

FAQs

Package last updated on 05 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts