I have an Angular web app (client - Angular 9, server - Java),
and now I want to add new components to be rendering on the server (e.g. Express-engine) using Angular universal.
My goal is to keep running the all app as regular in browser and only the specific module of the new components will render on the server. The website should be loaded as usual, and when routing to specific part of the app it will load the pre-render module from the server.
Is it possible to render only part of the web on the server?
Thanks!
EDIT:
As @izmaylovdev suggest,
I tried to edit the server.ts with the below get:
// All regular routes use the Universal engine
server.get('*', (req, res) => {
res.sendFile(distFolder + '\\' + indexHtml);
});
// Specific route
server.get(matcherForSpecificRoutes, (req, res) => {
res.render(indexHtml, { req, providers: [{ provide: APP_BASE_HREF, useValue: req.baseUrl }] });
});
But how can I see the different behavior? I can see a different log only on serve to the different URLs.