Johnny Oshika
Johnny Oshika

Reputation: 57502

How to set rootURL in Ember CLI

I'm trying to change the roolURL in an Ember CLI app. This is easy in a basic Ember app:

App.Router.reopen({
  rootURL: '/blog/'
});

Doing this in an Ember CLI app throws the following exception:

Uncaught TypeError: Cannot read property 'reopen' of undefined 

The reason why I'd like to do this is that I'm going to have multiple Ember CLI apps inside of a rails app. The URLs will look something like this:

/ --> rails
/foo --> rails
/api --> rails
/admin --> Ember CLI
/blog --> Ember CLI

Upvotes: 3

Views: 2052

Answers (1)

Richard A
Richard A

Reputation: 2100

You'd want to update your config/environment.js as follows:

module.exports = function(environment) {
    var ENV = {
        environment: environment,
        baseURL: '/blog/'

see http://www.ember-cli.com/#deployments for environment specific configurations.

Upvotes: 5

Related Questions