Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 22nd, 2012  |  syntax: None  |  size: 1.66 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. var app = require('express').createServer();
  2.  app.get('/status/201', function(req, res){res.send(201);}); // Created
  3.  app.get('/status/202', function(req, res){res.send(202);}); // Accepted
  4.  app.get('/status/204', function(req, res){res.send(204);}); // No Content
  5.  app.get('/status/206', function(req, res){res.send(206);}); // Partial content
  6.  app.get('/status/301', function(req, res){res.send(301);}); // Moved permanently
  7.  app.get('/status/400', function(req, res){res.send(400);}); // Bad request
  8.  app.get('/status/401', function(req, res){res.send(401);}); // Unauthorized
  9.  app.get('/status/403', function(req, res){res.send(403);}); // Forbidden
  10.  app.get('/status/404', function(req, res){res.send(404);}); // Not found
  11.  app.get('/status/405', function(req, res){res.send(405);}); // Method not allowed
  12.  app.get('/status/406', function(req, res){res.send(406);}); // Not acceptable
  13.  app.get('/status/410', function(req, res){res.send(410);}); // Gone
  14.  app.get('/status/413', function(req, res){res.send(413);}); // Request entity too large
  15.  app.get('/status/418', function(req, res){res.send(418);}); // I'm a teapot
  16.  app.get('/status/500', function(req, res){res.send(500);}); // Internal Server Day
  17.  app.get('/status/501', function(req, res){res.send(501);}); // Not implemented
  18.  app.get('/status/502', function(req, res){res.send(502);}); // Bad gateway
  19.  app.get('/status/503', function(req, res){res.send(503);}); // Service unavailable
  20.  app.get('/status/504', function(req, res){res.send(504);}); // Gateway timeout
  21.  app.get('/status/505', function(req, res){res.send(505);}); // HTTP version not supported
  22.  app.get('/status/dead', function(req, res){}); // No response
  23.  app.listen(3000);