write-response
v2.0.2
Published
Send a JSON or a text response to an http response object
Downloads
10
Readme
write-response
Send a response to a native node http(s) response object
Example Usage
json
import writeResponse from 'write-response';
writeResponse(200, { hello: 'all good here' }, response);
text
import writeResponse from 'write-response';
writeResponse(200, 'all good here', response);
with headers
import writeResponse from 'write-response';
writeResponse(200, '<strong>HELLO</strong>', { 'Content-Type': 'text/html' }, response);
License
This project is licensed under the terms of the MIT license.