Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clash between server and client side routing for serving of js files and images #5209

Closed
jjgriff93 opened this issue Jun 29, 2018 · 1 comment
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-spa

Comments

@jjgriff93
Copy link

I'm having an issue where my Angular app, hosted by ASP.NET Core MVC, isn't serving images and files like vendor.js, with a Failed to load resource: the server responded with a status of 404 (Not Found) error.

I'm using an Angular app template called ngx-admin, and it has an option to prepend the app's routing with /#/ (so the full url would be https://localhost:5001/#/pages/dashboard). With this enabled everything works fine, and the images are served from the angular app /assets/ folder as expected; however because I can't use fragments (#) in a callback URL for Azure AD B2C authentication that I'm currently setting up, I can't use this hash option.

I think the issue is that without the hash, the server side routing is clashing with the client side routing, and it's looking for images and scripts in wwwroot instead of the Angular application.

How can I go about changing the routing so there aren't any clashes? Would really appreciate any help here (happy to share code examples etc.)

Thanks in advance!

@aspnet-hello aspnet-hello transferred this issue from aspnet/JavaScriptServices Dec 17, 2018
@aspnet-hello aspnet-hello added area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-spa labels Dec 17, 2018
@mkArtakMSFT
Copy link
Member

Thanks for contacting us. We're closing this issue as there was no community involvement here for quite a while now.

@dotnet dotnet locked as resolved and limited conversation to collaborators Dec 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-spa
Projects
None yet
Development

No branches or pull requests

3 participants