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

http-status

Package Overview
Dependencies
Maintainers
0
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-status - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

CHANGELOG.md

8

package.json
{ "name": "http-status"
, "version": "0.0.1"
, "version": "0.1.0"
, "description": "Interact with HTTP status code"
, "author": "David Worms <david@adaltas.com>"
, "main": "./index"
, "contributors": [{"name": "Daniel Gasienica", "email": "daniel@gasienica.ch"}]
, "devDependencies": { "coffee-script": "1.x" }
, "main": "./lib/index"
, "engines": { "node": ">= 0.1.90" }
}
}

@@ -0,8 +1,7 @@

var HTTPStatus = require('http-status');
var HttpStatus = require('../index');
// Print "Internal Server Error"
console.log( HttpStatus['500'] );
console.log(HTTPStatus[500]);
// Print "500"
console.log( HttpStatus.InternalServerError );
// Print 500
console.log(HTTPStatus.INTERNAL_SERVER_ERROR);

@@ -0,18 +1,17 @@

var express = require('express'),
redis = require('redis'),
HTTPStatus = require('http-status');
var express = require('express'),
redis = require('redis'),
HttpStatus = require('../index');
var app = express.createServer();
app.get('/', function(req, res){
var client = redis.createClient();
client.ping(function(err, msg){
if(err){
return res.send( HttpStatus.InternalServerError );
}
res.send( msg, HttpStatus.OK );
});
app.get('/', function (req, res) {
var client = redis.createClient();
client.ping(function (err, msg) {
if (err) {
return res.send(HTTPStatus.INTERNAL_SERVER_ERROR);
}
res.send(msg, HTTPStatus.OK);
});
});
app.listen(3000);
app.listen(3000);

Sorry, the diff of this file is not supported yet

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