Skip to content

chenyang-charles/ChatRoom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tips

This chat room is modified from a templete on the Internet

It uses socket.io instead of ajax & long polling, and it doesn't use any database, if you need the chatting data, you can require mysql in route.js and save data.msg to your local mysql database

Usage

  • Run $node app.js
  • Use url localhost:8080 to go to login page.

How to Merge

  • Merge app.js, config.js and route.js to yours.

  • Change the route '/' to whatever you need in route.js and give two people in a same root a same id before redirecting.

  • In this demo, You need to input name and email first. What you should do is:

    • Delete < div class="connected"> part in chat.html and send the name and email from your page to chat.js.

    • Modify socket.on('peopleinchat', function(data){ part in chat.js to receive your massages and save them to variable email and name and run socket.emit('login', {user: name, avatar: email, id: id}); to start chatting!

About

Chat Room for Book Bridge

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published