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
npm i simpson-response
If you are working with typescript:
npm i --save-dev @types/simpson-response
// Usage
import SimpsonResponse from 'simpson-response'
app.get('/', (req: Request, res: Response) => {
res.send(SimpsonResponse.default.UNAUTHORIZED);
});
// Example
{
"url": "SimpsonImage",
"code": 401,
"message": "Unauthorized"
}
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.
The images with their respective HTTP response states have been made by WinkHosting.