简体   繁体   中英

How to create a server in Nodejs?

I am working on chat server so I want to create a server and I have been said to use express and socket.io module. Would someone explain me about these modules and help me making chat server?

When you post questions on Stackoverflow, it is expected that you provide some code that you have experimented with so far. Please refer here for details about how to ask a question.

However, from the looks of it, you seem to be someone who is just starting off with Socket.io and NodeJS. So I'm answering here so that someone else who might also be at your stage can get an idea where to start.

A good starting point for learning how to build Chat applications with Socket.io and NodeJS using Express can be found here on Socket.io's official website

Scotch.io also provides a good tutorial on this here


In a chat application, Socket.io provides an abstraction over the HTML5 WebSockets API on the client side, and implements WebSockets on the server side, where your server is running on NodeJS.


ExpressJS is a Web Framework built on top of Node, that provides you an easier API for building servers, and dealing with requests.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM