heroku javascript ajax post not returning anything -


i'm trying ajax post heroku server app , have app return response client web page (on different server).

it works fine if test locally (using localhost) when push heroku, no response.

app.js:

var express = require('express'); var app = express();  app.use(express.bodyparser()).post('/', function(req, res){ res.header("access-control-allow-origin", "*").header("access-control-allow-headers", "x-requested-with").header('access-control-allow-methods: post, get, options'); res.end("test"); });      port = process.env.port || 3000;     app.listen(port); 

client-side js:

$.post("http://myapp-name-here.heroku.com", {query: "anything", val: "something"}, function(data){      console.log(data); }); 

edited in:

when open client-side html page, when makes post request, gets status "canceled" after couple of seconds. ideas?

myapp-name-here.heroku.com no longer supported, try myapp-name-here.herokuapp.com


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

javascript - Clean way to programmatically use CSS transitions from JS? -

android - send complex objects as post php java -