MCPcopy Index your code
hub / github.com/restify/node-restify

github.com/restify/node-restify @v11.2.0

repository ↗ · DeepWiki ↗ · release v11.2.0 ↗ · + Follow
190 symbols 426 edges 120 files 83 documented · 44% updated 17d agov11.2.0 · 2024-01-27★ 10,687107 open issues
README

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 .

Core symbols most depended-on inside this repo

done
called by 244
lib/plugins/bodyReader.js
next
called by 150
lib/chain.js
cb
called by 36
examples/todoapp/lib/server.js
hrTimeDurationInMs
called by 8
lib/plugins/utils/hrTimeDurationInMs.js
serverMethodFactory
called by 7
lib/server.js
cpuUsageThrottle
called by 6
lib/plugins/cpuUsageThrottle.js
mergeQs
called by 5
lib/utils.js
flush
called by 5
lib/response.js

Shape

Function 185
Method 3
Class 2

Languages

TypeScript100%

Modules by API surface

lib/server.js14 symbols
examples/todoapp/lib/server.js12 symbols
test/response.test.js6 symbols
test/server.test.js5 symbols
test/plugins/inflightRequestThrottle.test.js5 symbols
test/lib/streamRecorder.js5 symbols
lib/plugins/throttle.js5 symbols
lib/plugins/pre/pause.js5 symbols
lib/plugins/conditionalRequest.js5 symbols
lib/chain.js5 symbols
test/router.test.js4 symbols
lib/upgrade.js4 symbols

Dependencies from manifests, versioned

assert-plus1.0.0 · 1×
autocannon4.0.0 · 1×
autocannon-compare0.4.0 · 1×
chai4.2.0 · 1×
coveralls3.0.3 · 1×
csv6.2.2 · 1×
documentation11.0.0 · 1×
escape-regexp-component1.0.2 · 1×
eslint5.16.0 · 1×
eslint-plugin-jsdoc3.15.1 · 1×

For agents

$ claude mcp add node-restify \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact