The issue it's that you are creating a connection to the queue for every post request to test-page. So you have to create this connection outside of the post handler.
I haven't tested the code but this should do the trick:
var express = require('express');
var app = express();
app.use(express.bodyParser());
var amqp = require('amqp');
var connection = amqp.createConnection({url: "amqp://guest:guest@localhost:5672"},{defaultExchangeName: ''});
connection.on('ready', function() {
console.log('connected');
});
app.post('/test-page', function(req, res) {
var messageToSend = req.body;
var queueToSendTo = "xyz";
connection.publish(queueToSendTo, messageToSend);
res.send(200);
});
app.setMaxListeners(0);
app.listen(80);