Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/restify/node-restify
The future of Node.js REST development
https://github.com/restify/node-restify
rest-api restify server
Last synced: 7 days ago
JSON representation
The future of Node.js REST development
- Host: GitHub
- URL: https://github.com/restify/node-restify
- Owner: restify
- License: mit
- Created: 2011-04-25T21:19:26.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2024-09-19T11:43:29.000Z (about 2 months ago)
- Last Synced: 2024-10-28T07:15:59.640Z (8 days ago)
- Topics: rest-api, restify, server
- Language: JavaScript
- Homepage: http://restify.com
- Size: 4.17 MB
- Stars: 10,711
- Watchers: 236
- Forks: 984
- Open Issues: 128
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
- awesome - restify/node-restify - The future of Node.js REST development (JavaScript)
- awesome-nodejs-cn - Restify - 帮助你构建正确的REST Web 服务 (包 / Web 框架)
- awesome-nodejs - Restify - Enables you to build correct REST web services. ![](https://img.shields.io/github/stars/restify/node-restify.svg?style=social&label=Star) (Repository / Web Frameworks)
- awesome-nodejs-cn - Restify - **star:10705** 使您能够构建正确的REST web服务 ![star > 2000][Awesome] (包 / Web 框架)
- awesome-repositories - restify/node-restify - The future of Node.js REST development (JavaScript)
- awesome-rest - node-restify - Framework specifically meant for REST API. (Servers / Node.js)
- awesome-github-star - node-restify
- awesome-nodejs - Restify - Enables you to build correct REST web services. (Packages / Web frameworks)
- awesome-npm - restify - 基于 connect,同时支持 Server / Client (1. 后端开发 / 1.2 框架)
- awesome-node - Restify - Enables you to build correct REST web services. (Packages / Web frameworks)
- awesome-nodejs-cn - Restify - 使你能够构建正确的REST Web服务。 (目录 / Web框架)
README
[![alt text][1.1]][1]
[1.1]: http://i.imgur.com/tXSoThF.png (twitter icon with padding)
[1.2]: http://i.imgur.com/wWzX9uB.png (twitter icon without padding)
[1]: http://www.twitter.com/restifyjs
![restify](/../gh-images/logo/png/restify_logo_black_transp_288x288.png?raw=true "restify")
[![Build Status](https://travis-ci.org/restify/node-restify.svg?branch=master)](https://travis-ci.org/restify/node-restify)
[![Dependency Status](https://david-dm.org/restify/node-restify.svg)](https://david-dm.org/restify/node-restify)
[![devDependency Status](https://david-dm.org/restify/node-restify/dev-status.svg)](https://david-dm.org/restify/node-restify#info=devDependencies)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)[restify](http://restify.com) is a framework, utilizing
[connect](https://github.com/senchalabs/connect) style middleware for building
REST APIs. For full details, see http://restify.comFollow restify on [![alt text][1.2]][1]
# Usage
## Server
```javascript
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
```javascript
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
```bash
$ 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 .
## Other repositories
- For the errors module, please go [here](https://github.com/restify/errors).
## Mailing list
See the
[Google group](https://groups.google.com/forum/?hl=en&fromgroups#!forum/restify)
.