Angular 9 path routing with SSR express PM2

Viewed 115

In the company we have an application made in Angular 9. In local everything works OK. But apart from the application we have an SSR server with node, express and PM2 that receives a post url, classifies it and then makes a GET call to the application in production, to render before displaying. The problem is that it gives me the following error

Cannot match any routes. Segment URL: last

This error comes to me through Putty's console with PM2 launched. The case is that it loads the page in the browser but loads the page corresponding to the 404 not found error.

I have tried to put

{path: "", redirectTo: "last", pathMatch: "full"} and {path: "", redirectTo: "last", pathMatch: "prefix"}.

Local routes were going well, even with the local SSR going well.

I am not the creator of this code, and I am the only frontend of the company right now. I don't understand what is wrong, if I modify {path: "**", component: NotFoundComponent} and upload it, it is really accessing the path file well, but when I try to access any page it always redirects to 404, I have even tried to remove it, but redirects to the web with blank content except menu and footer.

Thanks and regards

0 Answers
Related