Briefly introduce the function of this real-time web chat system, the first person to enter the system to fill in the name and e-mail address will get a system created by the URL address, you can send this address to another person, another person into the system can chat with you in real-time conversation. The main use of node. JS and Socket.io two libraries, in addition to the library has Express, Gravatar, Ejs, Detailed view Package.json, These libraries are required if they are not available locally and will be error-free and need to be installed with NPM install. You can download the demo source code to run the test.
Source code downloaded after the decompression has the following files:Node_modules-This is a dependent library generated by NPM after installationPublic --resource folderViews --Template path folderApp.js--System main program (main file), and the entrance is here.config.js--Configuration filePackage.json--Module Descriptionroutes.js--routing fileRun the system, go to the above extracted directory, enter:
node App.jsThe output is as follows, which indicates that the system started successfully:
Info-socket.io startedSystem successfully started http://localhost:8080 open browser input above URL should be able to see similar to the following welcome page: Live Chat effect: Download demo