Skip to content

esatterwhite/micromock-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);
});

About

Minimal HTTP Request / Response object for node js

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published