简体   繁体   中英

Angular Universal Deployment

I would appreciate if someone could clarify if it is necessary for hosting server to have node.js support in order for Angular Universal to work. And will I need to upload both browser and server folder in dist to the hosting. If yes, any recommendations on hosting a which offer such support? Secondly is there another way apart from node.js to make server side rendering to work?

Before answering this question, lets understand some basics of SSR and CSR in a layman language.

CSR or Client-side rendered

When a web-application gets rendered on the browser (Client-side). Here browser downloads all the html css and js first. Than the JS(your-some-awesome-framework) runs on browser and decide how the final webpage will look and act.

SSR Server-side Rendering

When a web-application gets rendered on the server (Server-side). Here the JS(your-some-awesome-framework) does most of its work on server already. So on your browser you gets the webpage without any delay of your JS booting and binding and rendering.


Now there are two types of rendering -

Dynamic SSR and Static Pre-rendering SSR

Dynamic SSR when a live server dynamically generate and serialize the application. When a user hit a URL of website, the server first generates the webpage and serve the content.

Static Pre-rendering SSR when there is already a pre-rendered static files and the browser simple serve those files.


Now comes the answers to your question in regard to angular framework.

  1. Is it necessary for hosting server to have node.js support in order for Angular Universal to work?

For Static Pre-rendering SSR - NO , there is no such need.

For Dynamic SSR - technically Yes , see below

  1. And will I need to upload both browser and server folder in dist to the hosting?

For Static Pre-rendering SSR - browser folder on any server which can host files

For Dynamic SSR - server folder on a nodeJs support server.

  1. is there another way apart from node.js to make server side rendering to work?

There are some ways to run node through ASP.NET Core and other options too. But for dynamic ssr nodeJs will come the the way.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM