Socket.io and Redis write Realtime APP Express preliminary

Source: Internet
Author: User

First step: Download the Express front-end framework with NPM

Caveats: First make sure that node. js and NPM are installed Then in the project to create a Package.json file, not completely empty not to write, at least two curly braces, otherwise how to prove that this is a JSON file, at least to a format bar (because of this small details, delayed for 10 minutes ...). )

Step Two: create a index.js file equivalent to a single entry file

The above error--"var http = require (' http '). Server (app);//import HTTP module for HTTP request

Run at the command line

Step three: install Socket.io

In the Package.json, you can see:

The client uses Socket.io as follows:

(http://www.bootcdn.cn/as Cheng, this CDN website should all know, but today only found so good, (*^__^*) hehe ..., cheer up ~ ~ ~, I come to be funny, haha)

Note To do behind, feel do not know how to describe, directly in the code to write comments, details see Code (⊙o⊙) Oh ~! ~~

Socket.io and Redis write Realtime APP Express preliminary

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.