0.1.1 • Published 8 years ago

rest-pathsuffix v0.1.1

Weekly downloads
4
License
ISC
Repository
github
Last release
8 years ago

Rest.js path suffix

Rest.js interceptor to add a suffix to the request path

Installation

Install Rest.js first if you haven't already.

npm install --save rest

Install path suffix interceptor

npm install --save rest-pathsuffix

Please note that this module is written in es2015 (es6). So you will need a transpiler like Babel to use it.

How to use

const rest       = require('rest'),
      pathSuffix = require('pathsuffix');

// Wrap pathSuffix interceptor
// Add .json to end of url
const client     = rest.wrap(pathSuffix, { suffix: '.json' });

// Calls /products.json
client('/products').then(response => {
    console.log(response);
});
0.1.1

8 years ago

0.1.0

8 years ago