koa-lite/lib/status.js

18 lines
259 B
JavaScript
Raw Normal View History

2013-08-17 07:15:57 +00:00
/**
* Module dependencies.
*/
var http = require('http');
var codes = http.STATUS_CODES;
/**
* Produce exports[STATUS] = CODE map.
*/
Object.keys(codes).forEach(function(code){
var n = ~~code;
var s = codes[n].toLowerCase();
exports[s] = n;
});