Skip to content
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
httpStatusCode
.DS_Store
.gitignore
README.md
index.js
package.json
test.js

README.md

node-httpstatuscode

to get httpstatuscode from msdn(http://msdn.microsoft.com/zh-cn/library/system.net.httpstatuscode.aspx).

httpStatusCode for node.js. Restfull api must be responsed a goog status. It can use with express.

npm install httpstatuscode

//demo:

var httpStatusCode = require("httpstatuscode");

var toBeEqual = function (actual,expected){ if(actual !== expected){ throw (actual + " not equal " + expected); } };

toBeEqual(httpStatusCode.OK,200); toBeEqual(httpStatusCode.Created,201); toBeEqual(httpStatusCode.BadRequest,400); toBeEqual(httpStatusCode.InternalServerError,500);

console.log(httpStatusCode); console.log("success");

Something went wrong with that request. Please try again.