user1320990
user1320990

Reputation:

Merge angular client app with nodejs server api - MEAN stack

I have an application developed from Angular Seed and a server from the Hackathon Starter. The applications run separately, the client on port 8000 and the server in 3000. How can I stack the client and the server in a single application?

Upvotes: 0

Views: 767

Answers (2)

Sean Larkin
Sean Larkin

Reputation: 6430

It sounds like you are wanting to know how to be able to run webpack-dev-server through your existing express app? This can be done by using webpack-dev-middleware. This allows you to integrate dev server with your existing express server.

Upvotes: 0

Shankar Morwal
Shankar Morwal

Reputation: 157

I think it is good to keep both projects separate. it makes the code more maintainable and when you deploy on the server then you minimize the load.

when you go on production you can run both projects on same server and expose for public on separate domain like api.example.com and example.com using ngnix and node.js.

if you still want to merge both projects then you can put angular code in public folder of node.js use it from there.

Upvotes: 1

Related Questions