I'm running a Digital Ocean server here on a MEN stack (MongoDB, Express, and Node), with a registration form: http://45.55.177.167:3000/register
If you try to select an option from the dropdown, I'm getting the following error:
GET http://45.55.177.167:3000/price?name=pro&cycle=monthly net::ERR_CONNECTION_REFUSED
I'm wondering why this is? I would like for the error to go away and get the response back so that the price changes accordingly.
My AJAX method:
$.get('/price', parameters, function(data) {
callback(data.price);
});
The Route:
app.route('/price').get(plans.getPrice);
The Controller:
var param_name = req.query.name;
var param_cycle = req.query.cycle;
var query = param_name + "_" + param_cycle;
Plan.findByName(query, function(err, selected_plan) {
var formatted_price = format_price(selected_plan.price) + '.00';
res.send({price: formatted_price});
});
This is working fine on my localhost, but when I deploy it to a droplet, I'm getting the error. Please let me know if clarification is needed.