I'm trying to integrate my Angular 4 app into asp.net mvc core project. And I'd like to have Angular app available within my Core MVC project with this Url - mydomain.com/ngx.
Here's how I do it now (and it doesn't work):
I build Angular app with angular-cli and use ng build ... --base-href /ngx (notice the slash). Then I copy everything from dist folder (where the build is placed by CLI) and copy it into wwwroot/ngx folder into my Core MVC project. But when I open localhost/ngx/index.html I get 404 errors for main.bundle.js and other js files. I checked the requests and for some reason it tries to get it as localhost://main.bundle.js - why from root?
now, if I build it with --base-href ngx (no slash) and open the site, it gets redirected to /ngx/ngx (doubles the ngx). so... wtf? :)
Core MVC routing doesn't have anything special, I haven't touched that part.
So how can I make it work as localhost/ngx ASP.NET Core MVC project?
ng build --base-href /ngx/ --output-path dist/ngx, running http-server from the dist directory, and going tohttp://localhost:8080/ngx/index.html.