How to servlets from ember

At a high level it would look like this:

  • Run ember build -e production (assuming you want to build for production)
  • Ember will build your app (which basically smashes all your app source and all your vendor source together into a few files and links them into index.html) and place it in <projectroot>/dist
  • Once that happens you have a built app which is just static files, so any static file server will be able to serve your Ember app. You simply need to place those files in the correct spot and configure your server appropriately.
  • One thing to note is that unless you’re using locationType “hash” you will need to tell Tomcat to do URL rewriting so it delegates ember routes to the ember app instead of trying to serve them itself. This applies to any single page application on any server. Here is a recent thread in this very board about configuring Tomcat that way. Unfortunately I can’t be a ton of help with that because I’m not super familiar with Tomcat in recent years.

Anyway, hope that helps with the basics at least. There’s a neat addon called ember-cli-deploy with a bunch of plugins that can help in a variety of deployment scenarios. I’m not sure if there’s anything that would specifically help with Tomcat deployment but it might be worth looking into once you have the basics working if you want more automated deployment.

1 Like