Ember CLI / Update / Production / 404

I developed my webapp using Ember CLI 0.1.15, with emberjs. 1.8.1

I created the application using this command: ember build --environment production, and then I made a WAR from the files created in the dist folder of my project, and then I delete the WAR in my tomcat webapps folder.

So, when I open the application: http: // mytomcat / myapp / ... everything went fine, I saw my login screen, I logged in, and navigating in my application, everything is in order. I could also do a back / forward button, and ember handles the transition well.

But when I click the update button in the browser - at that moment http: // mytomcat / myapp / inventory / was displayed in the address bar of the browser, I got 404 responses from tomcat.

Then I realized why this happened: the update button sends a request to tomcat for the path / myapp / myinventory / ... of course, the path / myinventory does not exist on the server. All these routes that we see in the browser, with the exception of the base url, http: // mytomcat / myapp / - are created on the client side.

So my question is: what is the right way (in ember) to handle this situation? I need a refresh button to just work. Anyway, for ember to catch the event with the click of an update button?

I think these problems are related to this: https://github.com/stefanpenner/ember-app-kit/issues/486 , but it does not have the answer I need.

Thanks in advance, Raka

--- UPDATE ---

Perhaps relevant: http://eviltrout.com/2014/04/10/the-refresh-test.html

+7
ember-cli
source share
1 answer
  • Inside the config/environment.js file, there is a locationType property. Set hash value

  • Manually moving files from the /dist folder is time consuming and annoying. Instead, you can specify the output-path property in your .ember-cli with a location inside webapps that you are trying to move files to. Another option is to specify this option ember server or ember build

+7
source share

All Articles