lundi 1 juin 2015

Serving ExpressJS and EmberJS together

I'm a little confused as how to join the client and server, specifically an EmberJS client connecting to an ExpressJS RESTful server.

In development, I have my Express server running, port 3000. Then, using

ember serve

I have a client running on port 4200. All is well so far, and the server and client work together.

Now, lets say I need to deploy to one server. This is where I get confused. I built my ember app, copied all of the files from "dist" to my "public" folder in my servers app. This works, and all the routing is handled by Ember - until I try navigating from the address bar. Then Express kicks in and tries to route the application, returning a 404.

How would a real world application be deployed, to say Heroku? They only option I can see is I have multiple apps running on Heroku - a server app and then a client app.

What are the best/common practices for this sort of setup?

Thanks




Aucun commentaire:

Enregistrer un commentaire