simpleChatApp | Simple chat app build with express.js and socket.io | Socket library
kandi X-RAY | simpleChatApp Summary
kandi X-RAY | simpleChatApp Summary
Simple chat app build with express.js and socket.io
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of simpleChatApp
simpleChatApp Key Features
simpleChatApp Examples and Code Snippets
Community Discussions
Trending Discussions on simpleChatApp
QUESTION
I am trying to learn how to make a chat App using socket.io
,ejs
,nodejs
...
So I am basically studying a code from the following repo: https://github.com/ngrt/simpleChatApp
The folder structure is like
simpleChatApp
(the parent folder)
-views(contains index.ejs
)
-public (contains style.css
and chat.js
)
-app.js (the file which has the server code )
app.js has app.use(express.static('public'))
so public works as root
Now the problem is in chat.js ( which contains the client-side backend)
below picture is a part of chat.js
ANSWER
Answered 2018-Dec-22 at 13:12The message received by client's socket.on
is emitted by nodejs's emit (and not client's one as in you code). This is node js
's code, where username is appended:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install simpleChatApp
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page