Permalink
Browse files

Update samples.

  • Loading branch information...
1 parent a119aa1 commit 89371b65ecba00218ae871ae5933ea52c13a6933 @gasi gasi committed Apr 18, 2011
Showing with 16 additions and 18 deletions.
  1. +4 −5 samples/api.js
  2. +12 −13 samples/express.js
View
@@ -1,8 +1,7 @@
-
-var HttpStatus = require('../index');
+var HTTPStatus = require('http-status');
// 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);
View
@@ -1,18 +1,17 @@
-
var express = require('express'),
- redis = require('redis'),
- HttpStatus = require('../index');
-
+ redis = require('redis'),
+ HTTPStatus = require('http-status');
+
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);

0 comments on commit 89371b6

Please sign in to comment.