I am having a nodejs server which will handle get and post requests.If a user gives a wrong method it throws an error. Below is my code
app.use(connectDomain()) // For error handling  
.use(connect.query()) // To use automatic query
.use(function(req, res, next) {
    if (req.method !== 'GET' && req.method !== 'POST') {
        res.end("invalid method")
    } else {
        next();
    }
})
.use(connectRoute(function (router) {
    // To Handle Get request
    router.get('/aaa', function (req, res, next) {         
        res.end("GET")
    })
    // To Handle POST request
    router.post('/aaa', function (req, res, next) {
         res.end("POST")
    })
    }))
But when I try to hit the delete method it does not send any response. It just listens and hangs up after a certain time. My nodejs runs in a linux environment. I am stuck here. Any help will be much helpful.