I am using connect module and connect route to handle get,post delete and put methods.Below is my code
var connectDomain = require('connect-domain'),
connectRoute = require('connect-route'),
connect = require('connect'),
app = connect();
app.use(connectDomain())
.use(connect.query())
.use(connectRoute(function (router) {
router.get('/aaa', function (req, res, next) {
console.log ("Got Trigger request to GET");
})
router.post('/aaa', function (req, res, next) {
console.log ("Got Trigger request to POST");
})
router.put('/aaa', function (req, res, next) {
console.log("Got trigger to PUT")
})
router.delete('/aaa', function (req, res, next) {
console.log("Got trigger to DELETE")
res.setHeader('Content-Type','text/plain');
res.end("in delete");
})
}))
When i hit the delete method i an getting the console correct for the first time,When i hit it for the second time the server hangs and is throwing me status 405.My environment is ubuntu and my connect version is 2.2.2 and connect route version is 0.1.3.Any help regarding this will be much helpful