1.1.0 • Published 7 years ago

lean-server v1.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Build Status Coverage Status

lean-server

A small library to handle http requests.

Installation

npm install lean-server

Usage

var lean = require('lean-server');

function sendResponse(res, text) { 
	res.writeHead(200, {'Content-type': 'text/plain'});
	res.write(text);
	res.end();
}
 
 lean.instance()
      .register('/hello', (req, res) => sendResponse(res, 'Hello world'))
      .register('/bye', (req, res) => sendResponse(res, 'Byeee'))
      .on(8081).start();