An open API service indexing awesome lists of open source software.

https://github.com/markwylde/write-response

Send a response to a native node http(s) response object
https://github.com/markwylde/write-response

http https response

Last synced: about 1 month ago
JSON representation

Send a response to a native node http(s) response object

Awesome Lists containing this project

README

          

# write-response
Send a response to a native node http(s) response object

## Example Usage
### json
```javascript
import writeResponse from 'write-response';
writeResponse(200, { hello: 'all good here' }, response);
```

### text
```javascript
import writeResponse from 'write-response';
writeResponse(200, 'all good here', response);
```

### with headers
```javascript
import writeResponse from 'write-response';
writeResponse(200, 'HELLO', { 'Content-Type': 'text/html' }, response);
```

## License
This project is licensed under the terms of the MIT license.