Fork me on GitHub
#lein-figwheel
<
2016-04-05
>
comamitc16:04:09

Hi all, I’m struggling with a concept and was hoping for a little bit of help in terms of configuration. I have a cljs-client and a cljs-server (node, express). The client is fairly straight forward when running with figwheel as it just gets served up at localhost:3449. I built the server following this pattern: https://gist.github.com/bhauman/c63123a5c655d77c3e7f and it also correctly is watched by figwheel and hot reloads my changes to the api port (3000). The problem I’m having is that because my server runs on a different port than my client I cannot make requests to that server from the client without CORS errors. So the question is, is there anyway to bind/proxy the cljs-server under the 3449 port as well? Am I thinking about this wrong? Thanks!

darwin17:04:07

@comamitc: what about adding CORS headers to your server? that sounds like a quick solution to me

comamitc17:04:41

The problem I have with adding CORS to my server is that this isn’t really the way I would run it in production. (with figwheel in particular) So I’d be adding CORS for dev only, which seems odd.

bhauman17:04:54

@comamitc: the simple solution is to serve you app html and assets from node. Everything will work then.