DEV Community

Discussion on: Do you want to run Angular App on the Node.js server?

 
saadabbasi profile image
Saad Abbasi

Yes, Tomas, you are right, but I have a front-end angular app with Angular material UI, I want to consume Payment API only for that purpose I need backend (Node.js). I thought to run the angular app on the express server on the same port.
that's why I followed this approach.
Do you have any other best solution/suggestion?

Thread Thread
 
hakimio profile image
Tomas Rimkus

Another solution could be to use CORS middleware on the backend side and to just serve Angular app with nginx or some other fast http server. Both approaches have their pros and cons.

Thread Thread
 
saadabbasi profile image
Saad Abbasi

yes, sure thanks for your discussion and feedback :-)
@tomas Happy coding