M
M
Maxim2015-04-08 23:03:10
JavaScript
Maxim, 2015-04-08 23:03:10

How to get rid of CORS?

The server is running sailsjs on port 1337. The client part, separate from the backend, runs on a separate server to serve static files (html, css, js) and uses port 9000.
Result:
client - localhost:9000
server - localhost:1337
CORS errors occur when the client contacts the server.
Of course, you can give statics inside the sails application, but my client is written in coffee and less, I don’t really want to load it with build tasks.
PS When the client part is launched inside the phonegap application, the question disappears, but what about on the localhost? Is it a client and/or server issue?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2015-04-08
Antonikhin @STJ

How to enable CORS in sailsjs

L
Lesha Fedoseev, 2015-04-08
@alexfedoseev

  • Try replacing localhost with lvh.me
  • Try testing localhost in Firefox. Chrome was having trouble understanding localhost.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question