Skip to content
Myr

copied STATUS_CODES from http.js - no longer exported by node

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by csausdev · committed by csausdev · parent b51d743 · Browse files · 1 file+45 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+45 added−3 removed

  • other:+45 added−3 removed

1 file+45 added−3 removed

modified:lib/express.core.js+45 added-3 removed
12// Express - Core - Copyright TJ Holowaychuk <tj@vision-media.ca> (MIT Licensed)34(function(){5 var http = require("http");6 process.mixin(GLOBAL, require("sys"));7 8 Express = { 9 version : '0.0.1',10 utilities : {},11 modules : [],12 routes : [],13 STATUS_CODES : {14 100 : 'Continue',15 101 : 'Switching Protocols',16 200 : 'OK',17 201 : 'Created',18 202 : 'Accepted',19 203 : 'Non-Authoritative Information',20 204 : 'No Content',21 205 : 'Reset Content',22 206 : 'Partial Content',23 300 : 'Multiple Choices',24 301 : 'Moved Permanently',25 302 : 'Moved Temporarily',26 303 : 'See Other',27 304 : 'Not Modified',28 305 : 'Use Proxy',29 400 : 'Bad Request',30 401 : 'Unauthorized',31 402 : 'Payment Required',32 403 : 'Forbidden',33 404 : 'Not Found',34 405 : 'Method Not Allowed',35 406 : 'Not Acceptable',36 407 : 'Proxy Authentication Required',37 408 : 'Request Time-out',38 409 : 'Conflict',39 410 : 'Gone',40 411 : 'Length Required',41 412 : 'Precondition Failed',42 413 : 'Request Entity Too Large',43 414 : 'Request-URI Too Large',44 415 : 'Unsupported Media Type',45 500 : 'Internal Server Error',46 501 : 'Not Implemented',47 502 : 'Bad Gateway',48 503 : 'Service Unavailable',49 504 : 'Gateway Time-out',50 505 : 'HTTP Version not supported'51 },52 53 // --- Halt54 55 Halt : function(){
173 unmodified lines
229 * @api private230 */231 232 listen : function(port, host, callback) {191 node.http.createServer(callback).listen(port, host)233 http.createServer(callback).listen(port, host)234 puts('Express started at http://' + (host || '127.0.0.1') + ':' + port + '/')235 },236 237 /**
122 unmodified lines
360 361 status : function(value) {362 if (value == undefined) return363 if (typeof value == 'number') return this.response.status = value322 for (var code in node.http.STATUS_CODES)323 if (node.http.STATUS_CODES[code].toLowerCase() == value.toLowerCase())364 for (var code in this.STATUS_CODES)365 if (this.STATUS_CODES[code].toLowerCase() == value.toLowerCase())366 return this.response.status = parseInt(code)367 },368369 /**
369 unmodified lines