jacrook
jacrook

Reputation: 40

Deploying a Mean Stack App, Apache?

I am starting to learn Angular and I am employing a MEAN stack. The grey area in my mind is when my angular app is finished and ready to deploy on a server.

Would I still need to use Apache of Nginx to route a domain or subdomain to my app?

I guess the node/express.js is my main question. I have used it when working locally, but when deploying would that run my app on the server side.

Thanks in advance.

Upvotes: 0

Views: 1626

Answers (1)

Matthew Bakaitis
Matthew Bakaitis

Reputation: 11990

You can run Node and your app on the server as-is, single-threaded...provided you took care of telling DNS where to reach the app.

To riff off your nginx question...here are a few of other deployment/config questions that you may consider:

  • server crashes: sooooo...node isn't at 1.0 yet and apps sometimes do unexpected things and die. tools like forever, supervisor and similar things can auto-restart the server.
  • logging: tools like morgan, winston and more can provide logging so you can see what was happening on the server before big events (everybody hit the same page, the server crashed every time page XYZ was hit, etc)
  • load balancing: a node server is single-threaded, single-instance. if you have a super busy site or you are stuck with synchronous stuff (blah!) you'll want to consider how to spin up multiple node instances. nginx and node clustering would be things to consider, but if your app is small, this is probably not a priority over handling crashes and logging

Upvotes: 2

Related Questions