Skip to content

Instantly share code, notes, and snippets.

@remotevision
Created February 19, 2013 01:32
Show Gist options
  • Save remotevision/4982339 to your computer and use it in GitHub Desktop.
Save remotevision/4982339 to your computer and use it in GitHub Desktop.
[2013-02-19T01:24:32.855Z] TRACE: restify/86380 on ryan.local: running pre chain (req.remoteAddress=127.0.0.1, req.remotePort=54533)
OPTIONS /deliveryMethods/51204d5ceaf649f325000007 HTTP/1.1
host: localhost:3000
connection: keep-alive
access-control-request-method: PUT
origin: http://localhost:3001
user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17
access-control-request-headers: accept, origin, content-type
accept: */*
referer: http://localhost:3001/
accept-encoding: gzip,deflate,sdch
accept-language: en-US,en;q=0.8
accept-charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
[2013-02-19T01:24:32.857Z] TRACE: restify/86380 on ryan.local: running _sanitizePath
[2013-02-19T01:24:32.858Z] TRACE: restify/86380 on ryan.local: checking for route (req_id=1d550c90-7a33-11e2-9fa8-b14cda34195d, req.remoteAddress=127.0.0.1, req.remotePort=54533)
OPTIONS /deliveryMethods/51204d5ceaf649f325000007 HTTP/1.1
host: localhost:3000
connection: keep-alive
access-control-request-method: PUT
origin: http://localhost:3001
user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17
access-control-request-headers: accept, origin, content-type
accept: */*
referer: http://localhost:3001/
accept-encoding: gzip,deflate,sdch
accept-language: en-US,en;q=0.8
accept-charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
[2013-02-19T01:24:32.861Z] TRACE: restify/86380 on ryan.local: router errored out (req_id=1d550c90-7a33-11e2-9fa8-b14cda34195d)
MethodNotAllowedError: OPTIONS is not allowed
at Router.find (/Users/ryan/dev/node/bandwango-node/node_modules/restify/lib/router.js:416:35)
at _route (/Users/ryan/dev/node/bandwango-node/node_modules/restify/lib/server.js:481:29)
at Server._handle (/Users/ryan/dev/node/bandwango-node/node_modules/restify/lib/server.js:559:33)
at next (/Users/ryan/dev/node/bandwango-node/node_modules/restify/lib/server.js:654:36)
at /Users/ryan/dev/node/bandwango-node/node_modules/restify/node_modules/once/once.js:17:15
at Server._sanitizePath (/Users/ryan/dev/node/bandwango-node/node_modules/restify/lib/plugins/pre/pre_path.js:39:25)
at next (/Users/ryan/dev/node/bandwango-node/node_modules/restify/lib/server.js:635:42)
at /Users/ryan/dev/node/bandwango-node/node_modules/restify/node_modules/once/once.js:17:15
at Domain.bind.b (domain.js:201:18)
at Domain.run (domain.js:141:23)
[2013-02-19T01:24:32.862Z] TRACE: restify/86380 on ryan.local: response::send entered (code=200, headers={})
body: {
"message": "OPTIONS is not allowed",
"statusCode": 405,
"body": {
"code": "MethodNotAllowedError",
"message": "OPTIONS is not allowed"
}
}
[2013-02-19T01:24:32.863Z] TRACE: restify/86380 on ryan.local: response sent
HTTP/1.1 405 Method Not Allowed
Allow: GET, PUT, DELETE
Content-Type: application/json
Content-Length: 67
Date: Tue, 19 Feb 2013 01:24:32 GMT
Connection: keep-alive
@remotevision
Copy link
Author

//server.js

server.pre(restify.pre.sanitizePath());
server.use(restify.CORS());
server.use(restify.authorizationParser());
server.use(restify.queryParser());
server.use(restify.jsonp());
server.use(restify.gzipResponse());
server.use(restify.bodyParser());

....

server.get('/deliveryMethods', deliveryMethods.findAll);
server.get('/deliveryMethods/:id', deliveryMethods.findById);
server.post('/deliveryMethods', deliveryMethods.addDeliveryMethod);
server.put('/deliveryMethods/:id', deliveryMethods.updateById);
server.del('/deliveryMethods/:id', deliveryMethods.deleteById);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment