Some explorations and thoughts on the front and rear end of Angularjs combined with NODEJS development

Source: Internet
Author: User

Angularjs is a very hot front-end mv* architecture in recent years, with a good community, document support, the design of sandbox mode, and the implementation of injection-dependent, providing very good code testing. This year on GitHub there are also endless plugins on angularjs. I will also use ANGULARJS in a number of practical projects, personal feeling, if there is a use of jquery and related plug-in experience of students, may be in the use of some do not adapt, but the overall said, the introduction is not particularly difficult, but when the problem encountered, It is recommended to look for the Angularjs community or stackfollow, or to see Angularjs source code.

Nodejs in recent years on the server side is also quite hot. Based on the V8 engine, event-driven, community, document support is very good, and node in the concurrency of the performance is really good, I was in touch with node when the layer of reference to Ali of a node performance test analysis. I also do some tests, the performance is really good.

Due to the needs of the project, I have actually participated in a number of angularjs+nodejs development, from the perspective of development and deployment, the later project, I will be based on the Angularjs building front-end projects and based on Nodejs built back-end services to separate, User access is the front-end static page, Nodejs built back-end service provides rest API, through the XHR matter front-end and back-end interaction, at first looks like a good loosely coupled architecture, and for the development of the front and back is really very convenient, but this architecture has a problem-cross-domain. Cross-domain issues, we can configure access-control-allow-origin,access-control-allow-headers,access-control-allow-credentials on the server side, Access-control-allow-methods, in the front-end of the XHR request to add Withcredential=true configuration, the original landlord also thought that the problem can be resolved, but when the front-end services and back-end services on different servers, In the part of the browser (the landlord is chrome34.0) found that the cookie information can not be saved, in fact, this issue is now discussed about the session Auth and Figure token auth problem, of course, the token behind Auth is able to solve the previously mentioned problem of not saving the cookie information, but the way token auth is not perfect, there are such problems. Personal feeling, the front-end and back-end of the distributed development is the future trend, but now there are some better solutions, such as passport, but from the actual production environment still have a certain distance.

Below the landlord to share a personal comparison recommended based on the angular building front-end architecture, such as:

There is nothing to say or need to communicate together, please do not hesitate to enlighten you

Some explorations and thoughts on the front and rear end of Angularjs combined with NODEJS development

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.