Problem with server sending a response

workspace
nodejs
server

#1

Recently I made a post about my server not responding when using the bot framework from microsoft … wasnt sure what was happening so decided to try another similar service … and with the same code it worked.

I am really stumped at what the problem might be.

   if (useEmulator) {
     var restify = require('restify');
    var server = restify.createServer();
    server.listen(8081, function() {
        console.log('test bot endpont at http://localhost:8080/api/messages');
    });
    server.post('/api/messages', connector.listen());  
    server.get('/',function(req,res,next){
        res.send('hello ' + req.params.name);
        next();
    });
   
} else {
    module.exports = { default: connector.listen() }
}