A simple example of NodeJS + Express + Socket. io

Source: Internet
Author: User

A simple example of NodeJS + Express + Socket. io
2. initialize a NodeJS web application: Open the CMD window. Run cmd: "mkdir myapp" to create a new folder named myapp. Run cmd: "cd myapp" and switch to the myapp folder. Run cmd: "npm init" to create the file package. json. 3. Express entry application: In the above CMD window, run cmd: "npm install express -- save", install "express" node_module, and "-- save" to save express to package. json. Add the app. js file to the myapp folder. Assume that the main file in package. json is app. js. Copy code // app. js var app = require ('express ') (); var http = require ('http '). server (app); app. get ('/', function (req, res) {res. send ('

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.