samedi 13 juin 2015

Ember frontend with node backend - development practices

I'm currently developing an ember frontend with a node backend.

In my ember-cli app I have an .ember-cli file set to proxy requests to node:

{
  "proxy": "http://localhost:3000"
}

I've also had to set a whole bunch of rules in contentSecurityPolicy to avoid cross site issues.

I start ember with ember server and it does successfully proxy ajax requests to my node backend - although it also proxies ajax requests from other libraries such as facebook to node (which fail with 404s).

The ember content is served from http://localhost:4200/

I also have a static landing page served directly from node which I can access via http://localhost:3000/home

Is there a better way to set it up more like it would be in production where all of the content is served from one address? Or do I have to develop in this isolated mode?

A proxy in front of both apps might do the trick, but it would still need the contentSecurityPolicy things as nothing would really be different from that perspective.




Aucun commentaire:

Enregistrer un commentaire