{"action":"closed","issue":{"url":"https://api.github.com/repos/strongloop/express/issues/2634","labels_url":"https://api.github.com/repos/strongloop/express/issues/2634/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/express/issues/2634/comments","events_url":"https://api.github.com/repos/strongloop/express/issues/2634/events","html_url":"https://github.com/strongloop/express/issues/2634","id":72729396,"number":2634,"title":"PUT and DELETE Routes inconsistent results parsing reg.query","user":{"login":"cloidjgreen","id":3143805,"avatar_url":"https://avatars.githubusercontent.com/u/3143805?v=3","gravatar_id":"","url":"https://api.github.com/users/cloidjgreen","html_url":"https://github.com/cloidjgreen","followers_url":"https://api.github.com/users/cloidjgreen/followers","following_url":"https://api.github.com/users/cloidjgreen/following{/other_user}","gists_url":"https://api.github.com/users/cloidjgreen/gists{/gist_id}","starred_url":"https://api.github.com/users/cloidjgreen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloidjgreen/subscriptions","organizations_url":"https://api.github.com/users/cloidjgreen/orgs","repos_url":"https://api.github.com/users/cloidjgreen/repos","events_url":"https://api.github.com/users/cloidjgreen/events{/privacy}","received_events_url":"https://api.github.com/users/cloidjgreen/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-03T01:33:25Z","updated_at":"2015-05-03T01:42:15Z","closed_at":"2015-05-03T01:42:15Z","body":"Using Express 4.12.3 and node 0.12.2 and attempting to implement CouchDB using cradle I attempted to use routes that mirror the CouchDB uses of http methods GET -- to read PUT -- to add create etc and DELETE -- to delete\r\n\r\nUsing a near line for line match with a PUT '/createDB' route and a PUT '/deleteDB' route the  PUT '/createDB' works consistently while THE '/deleteDB' ROUTE FAILS using either  the PUT or DELETE methods.\r\n -----  WEIRD -------  :-()\r\n\r\n```js\r\nrouter.put('/createDB', function(req, res, next) {    // WORKS !!!!\r\n    var db = new (cradle.Connection)().database(req.query.dbName);\r\n    db.create();\r\n    db.exists(function(err,exists){\r\n        if (err) res.send(req.query.dbName + ' not created');\r\n        if (exists) res.send(req.query.dbName + ' created');\r\n    });\r\n\r\n});\r\n\r\nrouter.put('/deleteDB', function(reg, res, next){      // FAILS\r\n    var db = new (cradle.Connection)().database(req.query.dbName);\r\n    db.exists(function(err,exists) {\r\n        if (err) res.send(req.query.dbName + ' does not exist');\r\n        if (exists) {\r\n            db.destroy();\r\n            res.send(req.query.dbName + ' destroyed');\r\n        }\r\n    });\r\n});  //  Notice that the syntax is essentially identical to the /createDB route above ???\r\n\r\nrouter.delete('/deleteDB', function(reg, res, next){   // FAILS\r\n    var db = new (cradle.Connection)().database(req.query.dbName);\r\n    db.exists(function(err,exists) {\r\n        if (err) res.send(req.query.dbName + ' does not exist');\r\n        if (exists) {\r\n            db.destroy();\r\n            res.send(req.query.dbName + ' destroyed');\r\n        }\r\n    });\r\n```\r\nThere is nothing wrong with the routes, the failure is on the parse \r\n The stack trace\r\n```html\r\n<!DOCTYPE html><html><head><title></title><link rel=\"stylesheet\" href=\"/stylesheets/style.css\"></head><body><h1>req is not defined</h1><h2></h2><pre>ReferenceError: req is not defined\r\n    at c:\\Users\\cloidjgreen\\WebstormProjects\\MGScheduler\\routes\\db.js:43:49\r\n    at Layer.handle [as handle_request] (c:\\Users\\cloidjgreen\\WebstormProjects\\MGScheduler\\node_modules\\express\\lib\\router\\layer.js:82:5)\r\n    at next (c:\\Users\\cloidjgreen\\WebstormProjects\\MGScheduler\\node_modules\\express\\lib\\router\\route.js:110:13)\r\n    at Route.dispatch (c:\\Users\\cloidjgreen\\WebstormProjects\\MGScheduler\\node_modules\\express\\lib\\router\\route.js:91:3)\r\n    at Layer.handle [as handle_request] (c:\\Users\\cloidjgreen\\WebstormProjects\\MGScheduler\\node_modules\\express\\lib\\router\\layer.js:82:5)\r\n    at c:\\Users\\cloidjgreen\\WebstormProjects\\MGScheduler\\node_modules\\express\\lib\\router\\index.js:267:22\r\n    at Function.proto.process_params (c:\\Users\\cloidjgreen\\WebstormProjects\\MGScheduler\\node_modules\\express\\lib\\router\\index.js:321:12)\r\n    at next (c:\\Users\\cloidjgreen\\WebstormProjects\\MGScheduler\\node_modules\\express\\lib\\router\\index.js:261:10)\r\n    at Function.proto.handle (c:\\Users\\cloidjgreen\\WebstormProjects\\MGScheduler\\node_modules\\express\\lib\\router\\index.js:166:3)\r\n    at router (c:\\Users\\cloidjgreen\\WebstormProjects\\MGScheduler\\node_modules\\express\\lib\\router\\index.js:35:12)</pre></body></html>\r\n```\r\n\r\nJust using GET to deliver the route and param works fine.  \r\nNot a desirable workaround.  I have debugged deeply into the stack and do not find the failure point.\r\nThe request seems intact deep into the code"}}