@dkx/http-response-server
v0.0.2
Published
Testing response server based on @dkx/http-server
Downloads
3
Readme
DKX/Http/ResponseServer
Testing response server based on @dkx/http-server.
Installation
$ npm install --save @dkx/http-response-server
or with yaml
$ yarn add @dkx/http-response-server
Usage
const {ResponseServer} = require('@dkx/http-response-server');
const server = new ResponseServer;
server.respondWith({
statusCode: 404,
statusMessage: 'Not found',
body: 'Data was not found',
});
server.run(8080, function() {
console.log('Server is listening on port 8080');
});
server.close(function() {
console.log('Server was closed');
});
See @dkx/http-middleware-response for all available respondWith()
options.