JSPM

  • Created
  • Published
  • Downloads 256619
  • Score
    100M100P100Q164882F
  • License MIT

REST framework

Package Exports

  • restify
  • restify/lib/bunyan_helper
  • restify/lib/clients
  • restify/lib/clients/json_client
  • restify/lib/clients/string_client
  • restify/lib/errors
  • restify/lib/errors/http_error
  • restify/lib/request
  • restify/lib/response
  • restify/lib/server
  • restify/lib/utils
  • restify/package

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (restify) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

restify

Build Status Gitter chat Dependency Status devDependency Status bitHound Score

restify is a smallish framework, similar to express for building REST APIs. For full details, see http://restify.com

Join us on IRC at irc.freenode.net in the #restify channel for real-time chat and support. Or see the Google group.

Usage

Server

var restify = require('restify');

var server = restify.createServer({
  name: 'myapp',
  version: '1.0.0'
});
server.use(restify.acceptParser(server.acceptable));
server.use(restify.queryParser());
server.use(restify.bodyParser());

server.get('/echo/:name', function (req, res, next) {
  res.send(req.params);
  return next();
});

server.listen(8080, function () {
  console.log('%s listening at %s', server.name, server.url);
});

Client

var assert = require('assert');
var restify = require('restify');

var client = restify.createJsonClient({
  url: 'http://localhost:8080',
  version: '~1.0'
});

client.get('/echo/mark', function (err, req, res, obj) {
  assert.ifError(err);
  console.log('Server returned: %j', obj);
});

Note that in future versions of restify, the clients have moved to a separate restify-clients repository and npm package.

Installation

npm install restify

License

MIT (see "LICENSE" file).

Development

Bugs

See https://github.com/restify/node-restify/issues.

Release process

Here is how to cut a release:

  1. Update the version in "package.json" and change ## not yet released at the top of "CHANGES.md" to:

    ## not yet released
    
    
    ## $version
  2. Ensure things are correct by running make versioncheck, then commit your change, with something like:

    git commit -am "$version"
    git push origin
  3. Run the following to tag and publish the release:

    make cutarelease