Server side

In angular universal app you have the server app module which will be bundled for the server. We need to use an interceptor, which will change request paths to load translations from the server.

Add an HTTP interceptor to app.server.module.ts , so it will be bundled only in the server bundle.

Since this code runs on the server side we can use Node.js capabilities. So we can get PORT of our server we are running on.

To make our interceptor get REQUEST object we need to provide it when we render our universal application.

That’s it.