rest-pathsuffix

0.1.1 • Public • Published

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);
});

Readme

Keywords

Package Sidebar

Install

npm i rest-pathsuffix

Weekly Downloads

0

Version

0.1.1

License

ISC

Last publish

Collaborators

  • timneutkens