javascript - Ember frontend with node backend - development practices -
i'm developing ember frontend node backend.
in ember-cli app have .ember-cli file set proxy requests node:
{ "proxy": "http://localhost:3000" }
i've had set whole bunch of rules in contentsecuritypolicy avoid cross site issues.
i start ember ember server
, proxy ajax requests node backend - although proxies ajax requests other libraries such facebook node (which fail 404s).
the ember content served http://localhost:4200/
i have static landing page served directly node can access via http://localhost:3000/home
is there better way set more in production of content served 1 address? or have develop in isolated mode?
a proxy in front of both apps might trick, still need contentsecuritypolicy things nothing different perspective.
in latest application i've been using ember.js frontend , node.js + express + mongodb backend.
i'm running 2 servers - nginx /dist
directory(static files, images etc.) on port 80 , node server api on other port. proxy requests begin /api/v1
(dynamic requests) express server:
upstream app_domainname.com { server ip.co.me.shere:1234; # port of node.js server running keepalive 8; } location /api/v1/ { proxy_pass http://app_domainname.com; proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; proxy_redirect off; proxy_buffering off; proxy_set_header host $host; proxy_set_header x-real-ip $remote_addr; proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; }
i don't want serve static files via express server because nginx seems have better performance dealing them.
Comments
Post a Comment