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

How does the SSR work in chapter 3? #42

Open
szliuxf opened this issue Apr 26, 2021 · 3 comments
Open

How does the SSR work in chapter 3? #42

szliuxf opened this issue Apr 26, 2021 · 3 comments

Comments

@szliuxf
Copy link

szliuxf commented Apr 26, 2021

I watched the video but not sure I understand how SSR works with Asp .Net integration. the WWWRoot serves the initial request, how does it get rendered by the server? The express server needs to be up? How does the request get handled by express when the request was initially sent to asp .net server?

@pkellner
Copy link
Owner

@szliuxf , the original request comes from the express server also. In my course, the only scenario I talk about for integration with asp.net is REST calls cross domain. Unfortunately, the asp.net team removed all solutions that integrate with React that include server-side rendering directly from asp.net.

@szliuxf
Copy link
Author

szliuxf commented Apr 27, 2021

Thank you! Were you referring to the nodeservice got deprecated? What are the ways to do SSR if I still want to use asp .net core and react.js together?

@pkellner
Copy link
Owner

No, the original templates Microsoft had when ASP.NET Core 2 came out supported server-side rendering with React. That did it by launching a node server from the asp.net core process and then had some communication with that. I found it pretty buggy and hard to work with. Lots of permission issues, webpack config problems, etc. The reason they still have two different templates for React (one with redux and one without) is that they needed a way to manage state on the client in order to retain that for the server side render. Now, they just kept redux because the world believes they have two different templates, but there is no reason they need to have a redux example anymore.

All that said, I don't see a benefit in running a node server inside the microsoft server our outside it. It is still two separate servers running. That's why in my course, I talk a lot about the separation of concerns between the two servers. Node and ASP.NET. In other words, you can't do server side rendering without node running on the server. ASP.NET is not enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants