http-status
Advanced tools
Comparing version 0.0.1 to 0.1.0
{ "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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
7516
9
42
1
108
3