How to run emberJS application in IIS?

前端 未结 3 1346
执笔经年
执笔经年 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 08:08

    I know this question is old but i found a very nice solution to the problem using the IIS URL Rewrite module (https://www.iis.net/downloads/microsoft/url-rewrite) which basically mimic's apache's mod_rewrite.

    Basically you define the rewrite rules in a web.config you place along side the dist/* files you dropped into an IIS directory and then go to town.

    Here is my rewrite rule block in my web.config.

    
        
            
                
                    
                        
                        
                        
                            
                            
                        
                    
                
            
        
    
    

    If you remove the IsDirectory check then it will still use IIS's 404 for bad directories.

    This allows you to host ember applications in IIS without using the /#/ technique.

提交回复
热议问题