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