const chatIO = require('socket-chat.io');
```bash
# Steps to setup chat socket on server (nodejs)
```bash
# Install Express
const express = require('express');
const app = express();
const http = require('http').createServer(app);
const chatIO = require('chat.io');
// For Setup Socket connection
global.io;
global.socket;
(async function () {
io = await chatIO.socketSetup(http);
// for connection event
socket = await chatIO.socketIoConnection(io, {});
console.log('socket', socket);
})();
// This socket is can be used to emit or listen a event on connection
app.get('/', async function(req, res) {
socket.emit('first', "firstData");
res.end(req.url);
})
```bash
This module uses two other main modules that are referred to, at the end of this page. \
Besides, [**socket.io**](https://socket.io/) tools are utilized for having a better performance.-
Notifications
You must be signed in to change notification settings - Fork 0
dgeetesh/chat.io
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
About
This package includes the chat functionality by using socket.io
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published