Routing an Angular 2 app with Web API

后端 未结 2 804
一生所求
一生所求 2021-02-10 14:24

I have an Angular 2 application created with Angular CLI. This has to call a .NET 4.6 Web API. The route setup of this is driving me nuts.

For Angular, the default folde

2条回答
  •  情书的邮戳
    2021-02-10 15:08

    I just couldn't get Dmitriy's answer to work for me, but he did put me on the right track.

    I needed two rules: One to serve the Angular app from the root while maintaining the Web API /api/ routing, and another to serve the default document.

    Here they are:

    
      
          
            
            
              
            
            
          
          
            
            
          
        
    
    

提交回复
热议问题