0

I made a client-side web application for fun and I recently try to integrate it with server-side stuff.

Using brunch as a starter for client and gulp as a start for server.

I am not sure how to send requests from client when they have different ports. I get a cross domain request issues. I googled but still have no clue.

Mazer
  • 11
  • 2
  • 2
    Did you stackoverflowed? like [How do I send a cross-domain POST request via JavaScript?](http://stackoverflow.com/questions/298745/how-do-i-send-a-cross-domain-post-request-via-javascript) – fuyushimoya Jul 09 '15 at 17:02

1 Answers1

2

Different ports are treated as different domains, so XHR cross-domain rules apply. You could set server-side to pass XHR requests using proper headers: How to enable cross-domain request on the server?

Another way is to prepare some cross-domain proxy that could forward your requests wuthout editing your server code, e.g.:

Community
  • 1
  • 1
SzybkiSasza
  • 1,591
  • 12
  • 27