rn

restify-namespace

Namespace your restify routes

Showing:

Popularity

Downloads/wk

12.9K

GitHub Stars

13

Maintenance

Last Commit

7yrs ago

Contributors

0

Package

Dependencies

0

Size (min+gzip)

0.4KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

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.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial