IoT front-end backstage 1--a hardware dog's learning process

Source: Internet
Author: User

From the last write Mqtt article, imperceptible already three months, originally intended to write their own build Mqtt Borker, but this information as long as 100 degrees have, difficulty is not small, plus the project is busy, has no time to write articles. From the beginning of last month to learn node.js slowly build their front-end and backstage program. In fact, in the July when the contact to Node.js, has always had the idea to build belongs to a network of their own platform, after the attempt to use C + + or C # to build. But the two languages are not too familiar, but also to learn a long time to get started, have been looking for a relatively simple platform to achieve, until contact with the node.js (in fact, Python and node.js similar also easy to build, once also struggled to learn Python or node.js).

Write here is not too deep, after all, they are just learning, as a person engaged in embedded, has not been too much contact with the upper layer of programming, learning or more arduous, especially business logic. On the main record of their own learning process, to share with you.

Node.js basic knowledge as long as Baidu is very much, here is not written, recommend everyone a better Learning Site rookie Tutorial http://www.runoob.com/, there is a very comprehensive variety of language and platform of basic learning. Blog words recommended "a minimum system of things networking design and source code" https://www.phodal.com/blog/bare-minimum-iot/, I just see this blog to contact Node.js, the front of the great God, also a book Do-it-Yourself design things networking, and open source of their own source code, I just started in his source code to repair changes, and then feel a little progress has not, not out of his frame. So decided to start from scratch their own step-by-step build, here Reference "KOA2 from the start to landfills" http://www.jianshu.com/p/6b816c609669 all the way to learn.

First of all, write the simplest node.js installation and KOA2 installation today. Node.js support multi-platform, all platform installation package can be downloaded in the official website, English is not good, you can node.js Chinese web http://nodejs.cn/download/to download. Windows version of the installation is very simple, always next on it, install nothing to say. After installation, open cmd, input node-v can see the version number of Node.js to install it. Enter node directly into node's console, enter Console.log (' Hello World ') and return, and the console prints "Hello World."

Linux installation is simpler, such as Ubuntu, in the console with Apt-get install Nodejs can be installed, and then Apt--get install NPM installation Node Package Manager. After installation, you can also view the version number of the Node.js in the console input node-v.

Next install KOA2, under CMD or shell under the input NPM intsall koa2, then node.js will automatically download KOA2 module. Then install the KOA2 template Generation tool NPM install-g koa-generator. Then go to the specified directory and enter KOA2 IoT to create a template named IoT. Then CD IoT into the folder and enter the module that the NPM install installation module relies on.

When the installation is complete, enter NPM start and start the node program. Open the browser, in the address input localhost:3000 can see KOA2 has been carried out, a basic server program is running.

Related Article

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.