Built a chatroom that can send & get message from all on-line user.
- Turn my HTML code to Jade.
- CSS.
- Enter detected.
- Using Socket.io API to send/get message.
- Connect to MongoDB to store history messages(use JSON).
- Show on-line Users.
- Modify to AngularJS.
###If you want to get whole project, just follow these steps:###
####step1####
make sure you have some necessary things installed:
- install node.js
- install npm(we need it to download packages)
- enter the following command
npm init
- enter the following command
npm install express
- enter the following command
npm install express-generator@4
- download Socket.io (Please install the latest version)
- enter the following command
npm install mongodb
- enter the following command
npm install mongoose
- You can also goto Socket.io for some example APP Socket.io APP
####step2####
git clone
enter the following command
git clone https://github.com/brianhuang1019/ChatRoomAPP.git ChatroomAPP
####step3####
Open the database
You need to create the path /data/db on the root directory and then make /data & /data/db writable
sudo mkdir /data /data/db && sudo chmod 0777 /data /data/db
and then enter the following command
cd ChatroomAPP && sh db.sh
if you can't open the database, try the commands below: (for Mac OS only, for other OS, plaese see: mongoDB)
brew update
brew install mongodb
and create /data & /data/db and set it's priorty bits, then go to step4
####step4####
Open the server
enter the following command
make run
####step5####
Open Web page
Open your browser and goto http://127.0.0.1:3333/ You can see the chatroom
The history message is located at http://127.0.0.1:3333/message