0

I come from the LAMP world. Greetings.

I'm trying to get started with the new Angular and Node.js. I already have Node and an Express server installed on my machine. Now I want to use Angular as I start building my app.

One thing I don't understand is why the Angular CLI is spinning up a server to "run the application" and why it seems we have to setup proxies and do other things to get it to work with Express.

When I think of Angular, I'm most familiar with AngularJS as part of my LAMP stack workflow. All I do here is serve it as a .js file and serve it from the same webserver that is serving everything else. Why is a client-side script getting its own server? How is it different from Express and how does it fit in with Angular Universal, which I would like to use to take advantage of SSR.

I'm not looking at how to get it all to work, I can copy and paste and read docs just fine, I'm trying to understand the fundamental concept here. The Angular docs don't explain why they are asking you to "serve the application". Is it just to test it? Why would I have two servers in development and one in production, shouldn't the dev site mirror the production site as best as possible?

Summer Developer
  • 2,056
  • 7
  • 31
  • 68
  • *Why is a client-side script getting its own server?* - because there's no web server to serve it? *How is it different from Express* - it's already Express, preconfigured to serve SPA. *shouldn't the dev site mirror the production site as best as possible* - no. Dev server allows to incrementally push updates to the browser. You don't have to press F5 on every change. That's the point. – Estus Flask Mar 16 '18 at 14:26
  • @estus Angular CLI `ng-serve` is spinning up an express.js server? – Summer Developer Mar 16 '18 at 14:28
  • 1
    Yes, it is indeed. – Estus Flask Mar 16 '18 at 14:34

0 Answers0