modulePrefix V/s baseURL


In the environment.js

what is the difference in setting modulePrefix V/s baseURL ?


The modulePreix is the name of your app that every module will be resolved as. It allows the resolver to find all the different pieces of your app once its built. If you look at the built assets you’ll see that each file is resolved something like:

define('module-prefix-name/controllers/application', ['exports', 'ember'], function (exports, Ember) {....

Or if you’re using pods:

define('module-prefix-name/podsFolder/application/controller', ['exports', 'ember'], function (exports, Ember) {...

The baseUrl is the url that the app expects to be served from. For most cases its the root /. But sometimes you’ll want it nested in your site. So it could be path/to/somewhere/else. Then when you would normally go to posts/post/1242, you would actually need to go to path/to/somewhere/else/posts/post/1242.

Hope that helps.