2.0.0 • Published 5 years ago

@esatterwhite/micromock v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

micromock-node

Minimal HTTP Request / Response object for node js

Initiall implemented for skyring and a replacement for hammock for use in ringpop while adding support for node >= 10

const {Request, Response} = require('micromock')

var req = new new Request({
        url: '/foo',
        headers: { host: 'localhost', bar: 'baz' },
        method: 'GET'
    }),
    res = new Response();

res.on('end', function(err, data) {
     console.log(data.statusCode);
     console.log(util.inspect(data.headers));
     console.log(data.body);
});