简体   繁体   中英

Is it possible to use server side rendering with existing server?

I have nodejs + express server for API and I'm supposed to build SPA using latest Angular. The SPA should have a couple of static HTML pages which should be rendered using server side rendering and some templating engine - probably Nunjucks. My question is, is it possible to use that existing API server for server side rendering? SPA + static pages should be under one repository/directory, API server is under another. API server will be under separate domain. Is it possible to have them under separate projects or is it only possible if I combine server and SPA into a single project? The latter I assume being a pain to maintain.

Yes, You can definitely use your existing node and express server. @angular/universal is used for Server Side Rendering. There will be separate Files for Server Configurations.

My Suggestion would be to make separate Repository for Angular app and let your existing one be as-is, that will help to maintain it better.

Please Follow " https://angular.io/guide/universal "

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