accessing apps on heroku giving error

0

I'm trying to install an app in heroku but I'm not getting it, so I can not see the status of my apps. My apps is a server in node.js and socket.io in heroku. There's a deploy option for the site that connects to git hub up so quiet but when I type the ip of the heroku that I believe is the address of the page of the app followed by the port of the server that is listening on port 8000 does not return anything.

is this:

link

It would be a remote connection my client stays at home and my server stays in heroku but I can not establish a connection and I do not even know if it is working because not only does it have a few files.

If you want to have a look, go to my server in the git hub by the following link and tell me what is wrong.

link

When I try to put this in my client that is in my house this error:

Blocked cross-origin request: Same Origin Policy prevents reading of the remote resource at link . (Reason: CORS request failed).

Will my client have it on the same server machine?

    
asked by anonymous 16.06.2015 / 05:18

1 answer

1

Try adding the cors module to your node.js server. And try adding it this way:

var express = require('express'),
    cors = require('cors'),
    app = express();

app.use(cors());

//rotas abaixo

If it still does not work, set cors this way:

var express = require('express'),
    cors = require('cors'),
    app = express();


var corsOptions = {
    origin: '*'
};
app.use(cors(corsOptions));

//rotas abaixo
    
15.10.2016 / 18:19