Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 373
Johnny Oshika Avatar asked May 20 '26 20:05

Johnny Oshika


1 Answers

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.

like image 67
Richard A Avatar answered May 22 '26 17:05

Richard A



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!