incito
v3.0.0
Published
Easiest way to turn a function into a web server!
Downloads
819
Maintainers
Readme
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'),
},
});