dotnet / AspNetCore.Docs

Documentation for ASP.NET Core
https://docs.microsoft.com/aspnet/core
Creative Commons Attribution 4.0 International
12.6k stars 25.29k forks source link

Consider including guidance about running ReactRedux pages as IIS sub-apps #7144

Closed ryanbrandenburg closed 5 years ago

ryanbrandenburg commented 6 years ago

In aspnet/templating#555 one of our users had trouble getting a react-redux app set up as a sub-application in IIS. We might want to add some instructions about how to use the homepage parameter in package.json to make that work. Details in the bug.

ghost commented 6 years ago

The problem with the homepage package.json approach as far as I can see, is that it's a static string defined at build time. So in the event that your IIS configuration changes (i.e. the sub-app is moved or renamed) you have to do a rebuild of the application which seems really bad to me. I guess you could possibly get away with manually changing the tag in the index.html but then you're manually changing the base html to fix your IIS routing.

Imo, we need a way to make this dynamic either by having .Net generate the homepage prefix and plugging it in at runtime, or we need to refactor the template to use a index.cshtml razor view where we can expose the kestrel URL in the viewbag. Or something else?

Rick-Anderson commented 5 years ago

@guardrex can you add a note to the appropriate doc For information on running ReactRedux pages as IIS sub-apps, see aspnet/Templating#555

Then we can close this issue.

guardrex commented 5 years ago

I'm not familiar with these technologies. Idk if this applies to the React project template, too.

@ryanbrandenburg, should I add a new section to the Use the React project template topic under the existing Publish and deploy section?

Rick-Anderson commented 5 years ago

@terndrup that sounds like really great info for the product. This is the doc's repo.