如何在Ember中设置根URL

时间:2013-03-22 12:31:48

标签: javascript url ember.js router base

我的Ember应用程序位于example.com/path/to/ember_app

我的问题是,Ember似乎根据站点根目录而不是应用程序的根目录来生成所有东西,所以当我希望ember能够根源于:

example.com/path/to/ember_app/**news_items**

我在500 (Internal Server Error)上获得example.com/news_items(GET)。

1 个答案:

答案 0 :(得分:1)

MyApp.IndexRoute = Ember.Route.extend({
  redirect: function() {        
    this.transitionTo('example.path');
  }
});

这应该可以帮到你,这基本上会将你的应用程序的索引路由重定向到example.path路由。

相关问题