Skip to content

restify/node-restify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

009f40b · Jan 27, 2024
Aug 11, 2023
Dec 10, 2019
Feb 5, 2014
Nov 23, 2021
Nov 29, 2022
Jun 18, 2023
Aug 11, 2023
Jul 11, 2020
Feb 12, 2014
May 22, 2015
Jul 10, 2020
Apr 1, 2020
Mar 12, 2020
Oct 31, 2017
Oct 31, 2017
May 12, 2016
Jan 27, 2024
Jun 27, 2017
Mar 14, 2019
Oct 19, 2017
Apr 25, 2011
Apr 1, 2020
Nov 15, 2022
Jan 27, 2023
Jan 27, 2024

Repository files navigation

alt text

restify

Build Status Dependency Status devDependency Status code style: prettier

restify is a framework, utilizing connect style middleware for building REST APIs. For full details, see http://restify.com

Follow restify on alt text

Usage

Server

var restify = require('restify');

const server = restify.createServer({
  name: 'myapp',
  version: '1.0.0'
});

server.use(restify.plugins.acceptParser(server.acceptable));
server.use(restify.plugins.queryParser());
server.use(restify.plugins.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 clients = require('restify-clients');

var client = clients.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);
});

Installation

$ npm install restify

Supported Node Versions

Restify currently works on Node.js v14.x and v16.x.

License

The MIT License (MIT)

Copyright (c) 2018 restify

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Bugs

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

Other repositories

  • For the errors module, please go here.

Mailing list

See the Google group .