simpson-response
v1.5.0
Published
Custom http error responses made with The Simpsons.
Downloads
2
Readme
HTTP Simpsons Responses
Custom HTTP responses with The Simpsons with the intention of expanding to all existing HTTP code. If you are interested in collaborating, please review the corresponding section.
Verify that you have the version of node: v18.12.0
Installation
npm i simpson-response
If you are working with typescript:
npm i --save-dev @types/simpson-response
Usage/Examples
// Usage
import SimpsonResponse from 'simpson-response'
app.get('/', (req: Request, res: Response) => {
res.send(SimpsonResponse.default.UNAUTHORIZED);
});
// Example
{
"url": "SimpsonImage",
"code": 401,
"message": "Unauthorized"
}
Contributing
Contributions are always welcome!
Steps for an effective contribution:
- Upload the image of the http code to an image bank.
- Create the object as follows: HTTPStatus { url, code, message }.
- You can see an example of the previous step here.
- Make a Pull Request. If you don't know how to make one, check the Github article.
Authors
Credits
The images with their respective HTTP response states have been made by WinkHosting.