I'm learning Angular.js for the first time, but there's a confusion in the http server configuration.

Asked 2 years ago, Updated 2 years ago, 56 views

I am a student who is studying node.js. Since I have only configured express.js so far, it is easy to automatically catch and route the View, but since I am trying to make SPA with Angular, I wonder if express.js is necessary.

If so, I think there is only a way to configure node web server+angular without express, but I'm a little confused because I haven't done it myself. Is there a good example?

node.js angularjs

2022-09-22 11:44

1 Answers

Even if you create a SPA with Angular, you need to establish an API server to communicate data with the server. To do so, it is possible with only the pure Node.js API, but it is recommended to use a framework that provides convenience such as Express.js.

To explain to you that there is a little misunderstanding, if you create SPA, you will dynamically create HTML rendering parts that were previously created through Express.js view and sent to the browser through the client (i.e., web browser) through Angular. Except for the view portion of Express.js, the rest of Router, Data Persistence (Model), and other parts of Middleware will be used equally for API operations.

The Express.js official guide document alone is not enough to build an API server.

https://scotch.io/tutorials/build-a-restful-api-using-node-and-express-4

I think it would be helpful to take a look at this tutorial.


2022-09-22 11:44

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.