loopback-datasource-juggler/lib/adapters/neo4j-lib/node_modules/http-status
Anatoliy Chakkaev f799e80fbb Freeze neo4j lib 2011-10-16 21:21:46 +04:00
..
lib Freeze neo4j lib 2011-10-16 21:21:46 +04:00
samples Freeze neo4j lib 2011-10-16 21:21:46 +04:00
src Freeze neo4j lib 2011-10-16 21:21:46 +04:00
test Freeze neo4j lib 2011-10-16 21:21:46 +04:00
.gitignore Freeze neo4j lib 2011-10-16 21:21:46 +04:00
CHANGELOG.md Freeze neo4j lib 2011-10-16 21:21:46 +04:00
README.md Freeze neo4j lib 2011-10-16 21:21:46 +04:00
package.json Freeze neo4j lib 2011-10-16 21:21:46 +04:00

README.md

HTTP Status

Utility to interact with HTTP status code.

Usage

API sample

var HTTPStatus = require('http-status');

// Print "Internal Server Error"
console.log(HTTPStatus[500]);

// Print 500
console.log(HTTPStatus.INTERNAL_SERVER_ERROR);

Express sample

var express = require('express'),
    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.INTERNAL_SERVER_ERROR);
        }
        res.send(msg, HTTPStatus.OK);
    });
});

app.listen(3000);

Contributors