Routing an Angular 2 app with Web API

后端 未结 2 635
刺人心
刺人心 2021-02-10 14:20

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 14:59

    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:

    
      
          
            
            
              
            
            
          
          
            
            
          
        
    
    

提交回复
热议问题