ovax3 / node-restc

minimal framework to compose RESTful clients

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RestC

Install

npm install restc

Usage

var client = restc({ port: 1337 },
  pluginA,
  pluginB,
  pluginC
);

client.get('/foo', function (err, req, res, data) {
  /* ... */
});

Plugin Structure

  • setup : invoked once when initializing a client to shape the default request options
  • before : invoked before issuing a request
  • after : invoked after a response has been received

example

{
  setup: function (options, next) { /* ... */ },
  before: function (options, next) { /* ... */ },
  after: function (req, res, next) { /* ... */ }
}

Available Plugins

About

minimal framework to compose RESTful clients


Languages

Language:JavaScript 100.0%