简体   繁体   中英

Deploying Angular Universal on Github Pages?

Anyone know if it's possible to Deploy Angular Universal to Github Pages? There are solutions like angular-cli-ghpages , but IIUC these do not prerender content for SEO.

It is not possible as GH-PAGES hosts only SERVES the html and js they do not run any node or pre-render engine in the back-end. It is simply html, js and css being served.

Maybe you are missing some concepts about Angular and Universal.

Universal is a back-end tool that act like a browser used by the server to load the url you request, process it and return the final HTML to the user as an HTML page. Things like permissions, routes, fetching data from server... are used to get this final view. Then when the google bot loads it, they get exactly what the user sees after loading the same page. The user also have less first load time because the html arrives in its final version.

Angular has three levels of build: JIT, AOT and PRE RENDER by the server. GH-PAGES accept only the first two, because for the last, they would need a server with Universal installed on it to run your app and PRE-RENDER it page befor sending to the client.

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