agnostic
A library that allows other projects to be agnostic of particular http server implementation.
Notice of change of ownership: Starting version 1.0.0 this package has changed it's owner and goals. Old version (0.0.0) is still available on npm via npm install agnostic@0.0.0
or on github. Thank you.
node / libs | express | restify | hapi | http |
---|---|---|---|---|
v0.12 | 3.x, 4.x | 2.x, 3.x, 4.x | 8.x, 9.x, 10.x | ✓ |
io.js | 3.x, 4.x | 2.x, 3.x, 4.x | 8.x, 9.x, 10.x | ✓ |
v4 | 3.x, 4.x | 2.x, 3.x, 4.x | 8.x, 9.x, 10.x, 11.x, 12.x, 13.x, 14.x, 15.x | ✓ |
v5 | 3.x, 4.x | 2.x, 3.x, 4.x | 8.x, 9.x, 10.x, 11.x, 12.x, 13.x, 14.x, 15.x | ✓ |
v6 | 3.x, 4.x | 2.x, 3.x, 4.x | 8.x, 9.x, 10.x, 11.x, 12.x, 13.x, 14.x, 15.x | ✓ |
Install
npm install --save agnostic
Example
Your Library
var agnostic = ; moduleexports = ; /** * Does cool things * * @param * @param */{ // do cool things // `request.body` - parsed request body // `request.query` - parsed query string // `respond` is a function with the following signature: // `respond([code], [content[, options]]);` ;}
Express
var express = ;var coolLib = ; var app = ; appall'/my-endpoint' coolLib; // start the serverapp;
Restify
var restify = ;var coolLib = ; var server = restify; server;server; // start the serverserver;
Hapi
var Hapi = ;var coolLib = ; var server = ; // setup hapi serverserver; server; // start the serverserverstart;
http
var http = ; var coolLib = ; server = http; // start the server server;
Want to Know More?
More examples can be found in test folder.
Or open an issue with questions and/or suggestions.
License
Agnostic is released under the MIT license.