How to run emberJS application in IIS?

前端 未结 3 1345
执笔经年
执笔经年 2021-01-12 07:22

I have an EmberJS application that is built using Ember CLI. To deploy my application I used the ember build --release command with Ember CLI, and copied the ou

3条回答
  •  春和景丽
    2021-01-12 07:58

    The easiest way to get get this to work on IIS, and similar to the way other route frameworks work in IIS like Sammy.js, is to include a hash in the url like this http://0.0.0.0:4200/#/your-route/

    In EmberJS, this is achieved by modifying the application router:

    var Router = Ember.Router.extend({
      location: 'hash'
    });
    

    In your case, since you're using ember-cli, you modify the environment.config file:

    var ENV = {
       ...
       locationType: 'hash'
       ... };
    

提交回复
热议问题