Skip to content

Latest commit

 

History

History
57 lines (46 loc) · 1.25 KB

readme.md

File metadata and controls

57 lines (46 loc) · 1.25 KB

incito

NPM Package Build Status Coverage

Installation

npm install incito --save
const incito = require('incito');

Usage

simple http server

const server = incito();
const port = server.port;

http server with listener

function handle() {
  // magical request handling code
}

const server = incito(handle);

express http server

const app = express();
const server = incito(app);

koa http server

const app = new Koa();
const server = incito(app.callback());

other types of servers

const server = incito({
  type: 'https',
  listener: app
  options: {
    key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
    cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'),
  },
});