statement:
- This article is suitable for White can not be white small white
- Do not be misled by the title, this article will not speak Nodejs Foundation, just My learning process and information of an integration
- If you want to find a lot of tutorials to see for yourself, no elevator, pull yourself to the bottom of the article
first, what is Nodejs? Some time ago, accidentally got a few Daniel Seniors learning opportunities, they are doing a startup project, the construction of the site is Nodejs; To this recent cow coax things, oneself also just slightly heard, From where to start, open Baidu, Google a bit. First, Nodejs is not a programming language, but a platform that allows JavaScript to run on the server side, and what Nodejs is written in C + +, based on Google Chrome's V8 engine, ignores What you need to know is that you used Php/java to write server-side code, now you can use Nodejs to do it, and you don't need much new knowledge. if (enough to be familiar with JS) { go on...... }else{ window.location (' http:www.baidu.com '); and search ' javascript starter Tutorial ' + go to-_-; } Second, using NODEJS development you can use windows/ Linux/macos, any environment, but it's weird to use Windows, recommend Linux (such as Ubuntu). As for the installation, solve it yourself. The next thing you want to know is that I have the tools to do the development, good, what do you have for me to transfer to Nodejs? So let's see what Nodejs is capable of. Ii. What Nodejs can do Node's avowed goal is "to provide a simple way to build scalable network programs." (pick) What is the problem with the current server program? Let's do a math problem. In languages such as Java™ and PHP, each connection will generate a new thread, and each new thread may require 2 MB of companion memory. On a system with 8 GB of RAM, theoretically the maximum number of concurrent connections is 4,000 A user. As your customer base grows, you must add more servers if you want your WEB application to support more users. In addition to these cost increases, there is a potential technical problem that users may use different servers for each request, so any shared resources must be shared across all servers. For all these reasons, the bottleneck in the overall WEB application architecture, including traffic, processor speed, and memory speed, is the maximum number of concurrent connections that the server can handle. Node is ideal for scenarios where you expect a high level of traffic before responding to the client, but not necessarily a lot of the server-side logic and processing required. summed up is: Other server-side language capable of almost all competent, and the goods can handle high concurrency, save server costs. It is not a substitute for server software such as Apache, and its ideal goal is to provide a highly scalable server. See it's dizzy again, huh? Forget it, look at yourself. Create a server, handle the request, response what it feels like.
third, how to learn Nodejs1. Which basis JS is required is the basis of the necessary, and is not a simple understanding can be, the front-end things must be mastered, or how you build a complete website application. 2. From where to start learning at the time, suffering from a very good tutorial in the country, can not say that the tutorial is bad, maybe they are standing in a relatively high point of view to tell this thing, a lot of things in that said, want to see the video students temporarily or do not have this idea, basically there is no suitable introductory tutorial, If you have to look for, English level can be, 51cto there is a I feel Good: 1>nodejs Foundation
- At first the tutorial looked at the http://ourjs.com/detail/529ca5950cb6498814000005, this is a book Ah, only looked at 1/3, give up
- Then we found the following tutorial: Https://github.com/alsotang/node-lessons took a few days to figure out the contents of the course, basically nodejs to use the basics.
- 51CTO Video tutorial, a total of 15 episodes, I did not see all, like the release of their own package this kind of thing 108,000, the top eight look still can, url:http://edu.51cto.com/course/course_id-127.html
2> Basic clearance, advanced use of the framework you may want to try to create your own application, it is necessary to introduce express, which is the development of a large project must be used, but if you are self-willed I can not. Express is a framework for Nodejs, just as you can build a website with basic Java Web knowledge, but using SSH can be faster and clearer. Just as you learn PHP, it's no problem to build a station directly, but there are frameworks like YII,TP and so on, and many wheels don't need to be made again. Express is the same thing, The author refers to Ruby's sinatra.rb, completed a NODEJS-based implementation (this sentence can be ignored), with the Foundation to practice, the above tutorial may be more or less about express, but the above focus on the Nodejs Foundation, the following is Express:
- If you do not want to see official documents for the time being, you can first look at Ruan Yi Feng Ruan Big "express Frame" http://javascript.ruanyifeng.com/nodejs/express.html
- Then, you can create a blog app to try, come on do it (discover this tutorial, a kind of brief encounter, want your feet) Url:https://github.com/nswbmw/n-blog/wiki
- But the official documents can not be placed here, there are questions first look at the Handbook: http://expressjs.com/
3> front-end what to do above the contents are all done, the front end is still using HTML, hehe, you guessed right, or HTML, but is a different way to write HTML, the front-end template engine currently has ejs, Jade, react and so on. Ejs do not have to learn, is to change a spread name, the syntax has not changed, server-side rendering may pass some data, you have to learn just a few simple syntax to deal with these data and logic, Refer to official documents to:http://www.embeddedjs.com/ Jade I personally do not like, the kind by indentation, space, line to organize the code of small shit, not accustomed to, do not say, want to learn, self-Google bar. REACT is not a complete MVC framework, it is V, on C is the icing on the cake, the component of the development of ideas, this should also be a trend, "write HTML in JS, you feel". " in web development, we always need to act on the DOM by reacting the changed data to the UI in real time. Complex or frequent DOM operations are often the cause of performance bottlenecks (how high-performance complex DOM operations are often an important metric for measuring a front-end developer's skills). React introduced the virtual DOM mechanism for this purpose: a set of Dom APIs was implemented with JavaScript on the browser side. All DOM constructs are made based on the react, and each time the data changes, react reconstructs the entire DOM tree, then compares the current entire DOM tree with the previous DOM tree to get the difference between the DOM structure, Then only the parts that need to be changed are actually updated in the browser DOM. "Think about it. Seniors told me that react water is very deep, if you can become an expert, promising. It's an emotional thing to hear:), anyway react getting started does have some difficulty,
- Here you can take a look at this first: http://hulufei.gitbooks.io/react-tutorial/content/introduction.html
- Then it is still ruan big: http://www.ruanyifeng.com/blog/2015/03/react.html can put code clone down, each demo to do, repair modify change try also understand.
- Last Official document Prerequisites: http://facebook.github.io/react/docs/getting-started.html
Summary: After reading these basically to nodejs knowledge has a complete system, if the foundation is not good, also did not know python such language, for Nodejs this so-called event-based asynchronous programming can make you very painful, look at someone's code, may find a lot of things do not know, It's okay. Those who rely on the library are Nodejs community contributions, each take to use can be, do not need special research, do not feel as if things are miscellaneous, then heart irritable, want to give up, this is just a process, tangled after the muddying. Appendix:
- Information one: Know how to learn node.js:http://www.zhihu.com/question/19793473 effectively
- Information Two: Quora:http://www.quora.com/what-are-the-best-resources-to-learn-node-js
Nodejs "pseudo" Getting Started tutorial