Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hapi-status-cat

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-status-cat

Hapi plugin that adds X-Status-Cat header to all responses, which contains the 'HTTP Status Cat' of the current status code.

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

hapi-status-cat

This Hapi plugin adds X-Status-Cat header to all your responses which contains the "HTTP Status Cat" of the current status code.

####Contributors

This is based off the http-status-cat Express middleware. Photos were collected by Tomomi Imura (GirlieMac) and are available here: https://www.flickr.com/photos/girliemac/sets/72157628409467125

####Example

server.register(require('hapi-status-cat'), function (err) {
  if (err) {
    console.error('Failed to load plugin:', err);
  }
  else {
    server.start(function () {
      console.log('Server running at:', server.info.uri);
    });
  }
});
$ curl -I localhost:3000/
HTTP/1.1 200 OK
X-Status-Cat: http://flic.kr/p/aVuVsF
content-type: text/html; charset=utf-8
cache-control: no-cache
Date: Fri, 12 Dec 2014 20:53:05 GMT
Connection: keep-alive
curl -I localhost:3000/nonexisting
HTTP/1.1 200 OK
X-Status-Cat: http://flic.kr/p/aVuVsF
content-type: text/html; charset=utf-8
cache-control: no-cache
Date: Fri, 12 Dec 2014 20:50:21 GMT
Connection: keep-alive

#####Just the cats

This can also be used just like http.STATUS_CODES:

var cats = require('hapi-status-cat').cats;

console.log(cats[403]);

####License

MIT

Keywords

FAQs

Package last updated on 18 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc