Тёмный

Build Real Time Chat Rooms With Node.js And Socket.io 

Web Dev Simplified
Подписаться 1,6 млн
Просмотров 114 тыс.
50% 1

In this video you will be expanding on a real time chat application by adding room support. You will use Socket.io to manage real time web socket connections to a Node.js server that will allow you to communicate real time chat messages to all clients connected to a single server.
Upon completing this project you will have a fully functioning chat application with room support. This project will also give you the basic groundwork needed to build complex chat applications such as Slack and Discord.
🚨 IMPORTANT:
Part One: • Build a Real Time Chat...
📚 Materials/References:
Starting GitHub Code: github.com/Web...
Final GitHub Code: github.com/Web...
Socket.io: socket.io
Top 8 JavaScript Array Methods: • 8 Must Know JavaScript...
🧠 Concepts Covered:
Using Socket.io to create web sockets
How to send messages to clients in real time
Handling chat room segregation
Appending elements with JavaScript
Sending messages to the server in real time
🌎 Find Me Here:
Twitter: / devsimplified
Discord: / discord
GitHub: github.com/Web...
CodePen: codepen.io/Web...
#ChatApp #RealTimeChat #JavaScript

Опубликовано:

 

4 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 190   
@18091991sk
@18091991sk 5 лет назад
This channel is criminally underrated! We really need to do something to make his videos viral.. Thanks from the bottom of my heart for all the quality content
@WebDevSimplified
@WebDevSimplified 5 лет назад
Thank you! I think I need to sacrifice a goat to the RU-vid algorithm gods or something along those lines to go viral 😜
@stanislava8650
@stanislava8650 4 года назад
@@WebDevSimplified Yeah, there is a serious problem with your channel, Kyle. I can't listen to anyone else anymore :)
@ankitdutta5240
@ankitdutta5240 4 года назад
@@WebDevSimplified can you please help me with uploading this to heroku?
@susmitislam1910
@susmitislam1910 3 года назад
Idk how many subs you had a year ago but now dear sir you are at nearly 500k subs. Thanks very much for the great tuts and hope your channel grows even more!
@ozzyfromspace
@ozzyfromspace 3 года назад
I didn’t know you could just specify a port and immediately connect 😮. I’ve always created an express server and passed the server object into the socket. Thank you, now I know something new! 🙌🏽✨💯🎊 You the man, Kyle!
@sp--nt1gg
@sp--nt1gg 4 года назад
that's awesome! everyone else is just talking about 20 minutes to explain every detail and it becomes very confusing, but you, just do amazing things that i was looking for months! videos are very short and informative, code is readable because it's pretty formatted, and most important, it's not confusing at all, even for me, i started learning node.js about 3 days ago but i understand! thanks! your channel is too underrated btw... (I shared with all my friends, and even not friends) keep it up man!
@bawbak8800
@bawbak8800 5 лет назад
Oh man thnak you so much, the quality of content, voice, code, explanation and everything is awesome. Good job man
@WebDevSimplified
@WebDevSimplified 5 лет назад
Thabk you so much. I'm really glad you enjoyed the video.
@JohnWeland
@JohnWeland 4 года назад
I am really enjoying this. I would love to see a series done to make a discord or slack like system. Even if its just single server. add in mongo for history and user along wit passport of JWT. man it would be rad.
@akn9699
@akn9699 5 лет назад
I have a request to each and everyone who is following this channel, This guy needs our support and we must spread this channel like an Amazon Wild Fire or even something more. I hope people like Kyle get better exposure. Come on guys, lets push this guy up !
@WebDevSimplified
@WebDevSimplified 5 лет назад
Thank you for the support. My channel is already growing at a crazy fast rate in my opinion and I am incredibly thankful for everyone that watches my videos.
@akn9699
@akn9699 5 лет назад
@@WebDevSimplified Great Update, so glad to hear ! Looking forward for more contents....
@Tcatcoder2
@Tcatcoder2 Год назад
thank you so much kyle this was my first backend project and I think I want to be a fullstack developer now
@dayanafulla3125
@dayanafulla3125 5 лет назад
just that i need! thanks for the videos!
@WebDevSimplified
@WebDevSimplified 5 лет назад
You're welcome! I am really glad you found it useful. I had a lot of fun making this video since chat rooms are fun to make.
@ManishKarki
@ManishKarki 5 лет назад
Yay! Just what I asked for. Thank you very much😊
@WebDevSimplified
@WebDevSimplified 5 лет назад
I hope you enjoyed it.
@ManishKarki
@ManishKarki 5 лет назад
@@WebDevSimplified You and Dev Ed are two guys who have been very helpful to me. Thank you.
@ObulRakhim
@ObulRakhim Год назад
great, 5 times I saw it, thanks !!
@rahulm5348
@rahulm5348 4 года назад
thankyou so much for such a good tutorial. please make a continuation video on this connecting mongodb database to store user chats
@SACHIN-gd6zy
@SACHIN-gd6zy 5 лет назад
This the best WebSocket Tutorial, hands down man You are a Sharp developer Tomorrow I am going to buy, your React.js Course without a doubt
@WebDevSimplified
@WebDevSimplified 5 лет назад
Thank you so much! I'm really glad you enjoyed this video and I hope you love the React course.
@ayushmanbt
@ayushmanbt 5 лет назад
Really awesome tutorial... Loving your tutorials ... Keep it up❤️
@WebDevSimplified
@WebDevSimplified 5 лет назад
Thanks!
@BruceArmstrong09121997
@BruceArmstrong09121997 4 года назад
this is an awesome tutorial ,me figuring out Socket.io for a whole day lol btw i added 2 lines of code Reason: Unless the server is restarted , the rooms can be created endlessly with out deleting it after all the users left the room socket.on('disconnect', () => { getUserRooms(socket).forEach(room => { socket.to(room).broadcast.emit('user-disconnected',rooms[room].users[socket.id]); delete rooms[room].users[socket.id]; //the added 2 lines of code const roomFull = rooms?.users; if (!roomFull) delete rooms[room]; console.log('user disconnected'); }); Hope it helps someone! thanks a lot !
@spiral_memory
@spiral_memory 3 года назад
You are great..Such an amazing project.. Explained properly 🎉🎉
@_benff
@_benff 4 года назад
Thanks a lot for this video and the previous one, very helpful!
@JohnWeland
@JohnWeland 4 года назад
You know building on this and the previous video, adding webRTC for video/audio chat would be neat!
@radanmitasik8793
@radanmitasik8793 5 лет назад
You and Dev Ed are my top two web dev channels..both so unique creators & teachers
@WebDevSimplified
@WebDevSimplified 5 лет назад
Thanks! Ed is awesome.
@radanmitasik8793
@radanmitasik8793 5 лет назад
@@WebDevSimplified So are you ! 😃
@tyrrelldavis9919
@tyrrelldavis9919 5 лет назад
Most overlooked channels on yt tbh, should be as popular as traversy
@WebDevSimplified
@WebDevSimplified 5 лет назад
@@tyrrelldavis9919 Thank you! One day I will be up there with Brad, but he started long before me and is still absolutely killing it with amazing tutorials. I hope to be able to help as many people as he has one day.
@francohelguera4039
@francohelguera4039 3 года назад
TypeError: Cannot read property 'emit' of undefined if you get this error, in order to fix it, you can delete the .broadcast, is not needed!
@incognito8336
@incognito8336 2 года назад
THANKSSSSS
@maskman4821
@maskman4821 5 лет назад
This is an awesome project !!!
@WebDevSimplified
@WebDevSimplified 5 лет назад
I'm glad you enjoyed it
@AtopService
@AtopService 2 года назад
Awesome! Would be really nice to know to implement this into a website! Glad it works for you tho!
@rajeshwarchennam3096
@rajeshwarchennam3096 5 лет назад
Thank you so much.. Such a good tutorial
@WebDevSimplified
@WebDevSimplified 5 лет назад
Thank you!
@liorocker1
@liorocker1 5 лет назад
How is it possible to build powerful real-time features in only 40 minutes with this 2-part tutorial series, Oh man, this is just amazing, without a doubt your way of teaching makes learning complex stuff a breeze, I really appreciate it.
@WebDevSimplified
@WebDevSimplified 5 лет назад
I am glad you resonate with my teaching style. I try to cut out all the unnecessary fluff and useless information to keep the learning per minute of my videos as high as possible.
@sp--nt1gg
@sp--nt1gg 4 года назад
@@WebDevSimplified learning per minute xd
@taihatranduc8613
@taihatranduc8613 3 года назад
you made a very good tutorial
@artzdesign2352
@artzdesign2352 5 лет назад
you are great ... more node.js projects .. big one's
@WebDevSimplified
@WebDevSimplified 5 лет назад
I have an entire full stack Node.js course on RU-vid if you want a bigger Node.js project.
@artzdesign2352
@artzdesign2352 5 лет назад
@@WebDevSimplified yup , i study it all .. i am asked for another one :)
@WebDevSimplified
@WebDevSimplified 5 лет назад
@@artzdesign2352 I will see what I can do. Thay project took me 3 months to build/record and I am in the middle of a react project right now.
@bipulsharma1357
@bipulsharma1357 4 года назад
Great content!
@kabeerjaffri4015
@kabeerjaffri4015 4 года назад
Thank u so much man
@jacobross5910
@jacobross5910 4 года назад
Not sure if I did something wrong, but my 'chat-message' emit was not sending the package to both sender and chat participants, only the participants (username joined the room and chat messages only showing on other clients). So instead of using socket.to(room).broadcast.emit('chat-message') I used io.to(room).emit('chat-message') and it worked.
@ahmetkaan2284
@ahmetkaan2284 2 года назад
Thank you for your response i have solved my problem related to your comment
@zlackbiro
@zlackbiro 4 года назад
Lool, this is insane... 😁 I created one-time pad encryption library to protect users messages before they goes true the socket.io. Even socket running true the ssl, its still vulerable because government services can decrypt ssl, but my app has power over it and convert message with the ascii dots. 😁
@jimhalpert9803
@jimhalpert9803 4 года назад
Good job
@eddiejaoude
@eddiejaoude 5 лет назад
Real-time is awesome 👍
@WebDevSimplified
@WebDevSimplified 5 лет назад
It is really fun to work with.
@martynas8160
@martynas8160 4 года назад
Hi , how can I delete chat room that is created ? I would like to know not only how to create but also how to delete the chat room
@harshagarwal2125
@harshagarwal2125 4 года назад
you are amazing
@Hamza-gn2cg
@Hamza-gn2cg 4 года назад
Thanks so fucking much, you fucking saved me lol
@ikramikky2838
@ikramikky2838 5 лет назад
very useful tutorial 🔥💥
@WebDevSimplified
@WebDevSimplified 5 лет назад
Thanks!
@sherifsalah5563
@sherifsalah5563 5 лет назад
Great, you are awesome 😁
@WebDevSimplified
@WebDevSimplified 5 лет назад
Thanks
@TheJacex16
@TheJacex16 5 лет назад
OMG you're the man! I have a question, how would you handle a kick/ban system??
@WebDevSimplified
@WebDevSimplified 5 лет назад
The best way to handle that situation would be to use a database to store users. Then you could also store whether or not the user was banned inside that database as well. One option, if you wanted to ban users from a single room would be storing rooms/users in their own tables and then have a third table that has the id of the user/room they are banned from.
@ishaantek
@ishaantek 3 года назад
@@WebDevSimplified How do we use a database?
@RollyC197
@RollyC197 4 года назад
Great tutorial. Easy to understand. As a new to Node.js and Socket.io, I was looking for chat apps tutorial to use for our website and I think this is the best tutorial I found. I went through and finished it. Now, I was trying to embed on our website but sent me '404 Not Found'. if I have index.php and want to put a "Chat with us" navigator, how can I do this? I mean how can I link this such as Chat With Us ? It gives me: { %> Join textbox is here then "New Room" Thank you for this tutorial.
@mossasameer3338
@mossasameer3338 4 года назад
thanks a lot
@ijazkhan3335
@ijazkhan3335 5 лет назад
Thanks. It was very helpful. Can you extend this with private chat?
@WebDevSimplified
@WebDevSimplified 5 лет назад
You can pretty easily. A private chat is just like a room but it is a room that ties directly to another users socket id. The docs for this library have a section on private rooms.
@ijazkhan3335
@ijazkhan3335 5 лет назад
@@WebDevSimplified Yeah I also wondered I'll do it that way, but still wanted to be sure... Thanks :)
@zlee9288
@zlee9288 3 года назад
Quick question, how would I get this to save to a database? Mongo to be exact.
@tabaicanking3701
@tabaicanking3701 5 лет назад
thanks bro
@WebDevSimplified
@WebDevSimplified 5 лет назад
You're welcome
@sp--nt1gg
@sp--nt1gg 4 года назад
why do you still don't have a tick after your channel name?
@carljoshuasanchez4828
@carljoshuasanchez4828 3 года назад
Great tutorial! Just one question, how can the room be deleted if there are empty users?
@MuhammadWaqas-ux1zu
@MuhammadWaqas-ux1zu 4 года назад
great video . (y)
@RobertWildling
@RobertWildling 4 года назад
The "room-created" event needs to check, if it has a "roomContainer" available (which is only on index.ejs), otherwise those, who are in a room, get ugly error messages once a new room is created. Third part: Deploy to netlify / zeit / etc?
@Gers217
@Gers217 3 года назад
Chat will never be ched again
@jonathanalbert920
@jonathanalbert920 2 месяца назад
can you please create a new project using the latest version of the package ? It changed a lot
@khoahuynh7468
@khoahuynh7468 4 года назад
can you do the same one with multiple chat rooms?
@difer1412
@difer1412 3 года назад
I have a question. Do you have any option to delete the created rooms? because these are pilling up. I have made so many in my Heroku app, and I want to delete these. Thank you for the tutorial
@ssumansaha3383
@ssumansaha3383 4 года назад
really awesome tutorial .... but i want to delete the rooms after use ...how do that pls help
@Naverdo
@Naverdo 5 лет назад
Really useful project! Learned a lot from it. Also if I wanted to connect to this site from another device what would i have to do?
@WebDevSimplified
@WebDevSimplified 5 лет назад
What do you mean?
@Naverdo
@Naverdo 5 лет назад
@@WebDevSimplified like have the server running and chat app open on my pc and then probably chatting with my friend who is on his pc
@WebDevSimplified
@WebDevSimplified 5 лет назад
As long as you host the site from this video on a place like heroku you can do that.
@Naverdo
@Naverdo 5 лет назад
@@WebDevSimplified OK thanks!
@Naverdo
@Naverdo 5 лет назад
@@WebDevSimplified I've tried to use heroku by myself but just got error after error. Could you do a tutorial on that or point me to a video?
@irednax
@irednax 3 года назад
This works locally for me, but when i deploy it to heroku it loads forever and doesn't ask me for my name. How do i fix this?
@Professorjak
@Professorjak 3 года назад
Hi Kyle, how do we add video chat to the chat rooms? Thank you
@fidellistaz766
@fidellistaz766 3 года назад
Can you make a random chat room system ,like a random chat app
@thanasisathanasi4965
@thanasisathanasi4965 4 года назад
Hello my friend. What is nodemon used for in your package.json?
@sp--nt1gg
@sp--nt1gg 4 года назад
idk same here
@slimmwillis
@slimmwillis Год назад
I am having a problem. I even downloaded from git and still it don't work. On ubuntu. I'm almost sure I did everything hint in the terminal right too.
@meteachesprogramming9395
@meteachesprogramming9395 5 лет назад
You should make a part 3 in which you show how to make privatised chat of only 3 people or show how to make them with password.
@WebDevSimplified
@WebDevSimplified 5 лет назад
I'm not sure if I will expand upon this series in particular but I may make a separate chat room series in the future.
@meteachesprogramming9395
@meteachesprogramming9395 5 лет назад
@@WebDevSimplified well ok but its kinda urgent if you have enough time please help me i know that being a youtuber is hard. So if you have time to do a vid please do. Thanks for the reply.
@WebDevSimplified
@WebDevSimplified 5 лет назад
@@meteachesprogramming9395 It won't be something I tackle anytime soon. I am incredibly busy and do not have time for a full project based video like that.
@kamikaze9822
@kamikaze9822 5 лет назад
nice video
@WebDevSimplified
@WebDevSimplified 5 лет назад
Thanks!
@htmoh8115
@htmoh8115 Год назад
Question. If you using websocket, do I still need myphpadmin? I'm new so pardon my ignorance
@williamjones0
@williamjones0 4 года назад
I'm using VS Code too, and have run `npm i express ejs` and they are both in my package.json, but EJS isn't appearing in the languages list, so it's not being formatted properly. Have I forgotten a step or missed something? I have also asked a question on StackOverflow here: stackoverflow.com/questions/59238175/visual-studio-code-isnt-recognising-ejs Edit: I have installed the EJS syntax highlighting plugin, but this still doesn't make the language appear in the list.
@mahanthd9915
@mahanthd9915 4 года назад
The 1st part of the code works properly but this one is not working please help me out
@eugenefedorov3498
@eugenefedorov3498 4 года назад
Thanks! But how you will make that users who are already in the room will NOT receive socket event when new room is created, as he dont need it.
@kamleshlakhara253
@kamleshlakhara253 4 года назад
would you make a video of chat room app using angular and save chat data using php api
@MatteoGauthier
@MatteoGauthier 5 лет назад
Hey thanks a lot, how can I store the message and display previous messages
@WebDevSimplified
@WebDevSimplified 5 лет назад
You would need to add the messages to a database like MongoDB
@TimeLords910
@TimeLords910 Год назад
i need some help i have a problem where devstart is missing as a command to run with the live server
@darthvader4899
@darthvader4899 3 года назад
in your rooms object you just store name of the room which is string and then you use to(roomName (which is string)) to emit event but how how does it know from just String
@Gigabyteserviceofficial
@Gigabyteserviceofficial Год назад
you should add a support to mongodb
@amjedallaya9688
@amjedallaya9688 5 лет назад
thnx
@WebDevSimplified
@WebDevSimplified 5 лет назад
You're welcome!
@zamankhan1255
@zamankhan1255 5 лет назад
please make a video on command prompt
@WebDevSimplified
@WebDevSimplified 5 лет назад
I have been planning to make a video on basic unix commands, but haven't gotten around to planning it out yet.
@kriann6194
@kriann6194 4 года назад
tags don't work for me :( help
@310-q1c
@310-q1c 4 года назад
me neither
@R_Samnan
@R_Samnan 3 года назад
Its EJS, you need to get that npm package
@zizo8737
@zizo8737 2 года назад
Please help my browsers are not connecting what to do😢😢😢😢
@mohammedsayeed330
@mohammedsayeed330 4 года назад
Shared Your channel link to my frirends..but please kindly add css to this app
@jasonreviews
@jasonreviews 5 лет назад
we need encryption part
@WebDevSimplified
@WebDevSimplified 5 лет назад
That is what SSL is for
@TheWorldGameGeneral
@TheWorldGameGeneral 2 года назад
is this somewhere available in Nestjs?
@khadijasworld3899
@khadijasworld3899 3 года назад
In my project I wanna give the right of creating rooms to a specific client ( in my case I want him to be the professor ) how can I set this condition ? Any help please!! 🙏
@francohelguera4039
@francohelguera4039 3 года назад
request a password for creating rooms? and just give that pass to the professor
@maheshmahadar4780
@maheshmahadar4780 3 года назад
in my website i cant use socket.oi multiple pages. is it valid or not i am doing ?
@shlokranjan5944
@shlokranjan5944 3 года назад
Cannot read property of users of indefined
@anurodhyadav1409
@anurodhyadav1409 4 года назад
Can you make a video on how to deploy this app in heroku....
@guygontar6106
@guygontar6106 4 года назад
Hi, In line 47, when broadcasting 'user-disconnected' event, why the parameter is socket id?
@ishaantek
@ishaantek 3 года назад
How can we moderate?
@play4fun181
@play4fun181 4 года назад
socket is not working :/ in google chorm but work with other browser. name cant detect keep saying null or undefine
@bogdanivchenko3723
@bogdanivchenko3723 4 года назад
I don't know why it doesn't work for me. I have the exact same code. Live server doesn't open .ejs files like html, it opens Listing directory/ where I can see my project filkes. If I click on index.ejs, it just downloads it. I added a .html file into the views folder and it opened it. I tried to open a ejs folder from file explorer and it opened it in firefox but it displayed the script as text. Somebody please help.
@maskman4821
@maskman4821 5 лет назад
Sir, I try to upload this project to glitch.com, but it is not working, the error messages indicates it has to do with https, can you fix the problem???
@WebDevSimplified
@WebDevSimplified 5 лет назад
It sounds like you need to enable https on the site. I have never used that site so I am not sure.
@sp--nt1gg
@sp--nt1gg 4 года назад
are you sure you installed socket.io correctly? glitch has in-build node.js at projects with "package.json" file. you must just go it and click on add package, type socket.io, click on 1st result(install button of 1st result) and you're done now follow video
@PawanYadav-yk9ng
@PawanYadav-yk9ng 3 года назад
Hello bro, how to limit only two persons in a room.
@trendymasthi7402
@trendymasthi7402 4 года назад
How can I escape whitespaces in join link in indez.ejs if room name(ex. Room One) contains whitespaces. Join
@trendymasthi7402
@trendymasthi7402 4 года назад
Got the solution
@user-or7ji5hv8y
@user-or7ji5hv8y 4 года назад
How about using a database with an event listener instead of socket.io? Is that a bad idea?
@abdullahdanish5329
@abdullahdanish5329 4 года назад
hey bro how to implement on online server plzz help how to excute node app.js on online sever
@dinero474
@dinero474 5 лет назад
it would be cool if you made something like omegle. Users connect to a random generated a room and only 2 users can connect
@Valnuss
@Valnuss 4 года назад
I have a question. How do I link stylehseets? I added some and it appears in my source-code. I can open the link via browser and the see code there but it isn't applied to the dom. Is there anything special I use to do? It's lying in the public dir next to script.js
@sp--nt1gg
@sp--nt1gg 4 года назад
@sp--nt1gg
@sp--nt1gg 4 года назад
FILENAME must be actual filename
@vampirejs758
@vampirejs758 3 года назад
How can I host this app
@carlonnrivers
@carlonnrivers 5 лет назад
This was both complicated in terms of the disconnect function, but actually very simple. Basically a bunch of socket.emits and socket.on for handling those emits. Thanks for this video. I have a couple questions though. Where you have @4:32 const rooms = {} and const users = {} Would that be how I have it in my Heroku server, or do I actually make rooms = require('Rooms'); assuming I have a rooms schema from mongoDB? @5:49, you changed the port from 5000 to 3000. I know in the heroku we did process.env.PORT. Do I use that variable there, or is there an additional environment variable I'd need to separate the port from the express and the socket? @6:45. line 8: How do I manipulate that for my own website url (which changes)
@WebDevSimplified
@WebDevSimplified 5 лет назад
If you are using a db you will need to heavily modify how the data is saved but you are correct in saying you need to import the model instead of using a local variable. Yes. You need to use process.env.PORT if you want to deploy this so your port will be dynamic. You can also set it to a default fallback by doing process.env.PORT || 3000. If you remove the localhost:3000 section and just leave it as /socket.io/socket.io.js it should work.
@Nanda-ho5eh
@Nanda-ho5eh 3 года назад
Can anyone suggest a way to add a databse to this chat app
@REBELxLOPEZ
@REBELxLOPEZ 4 года назад
Can these be converted to React?
@anurodhyadav1409
@anurodhyadav1409 4 года назад
How do i deploy this application??
@Hogo_-to7tv
@Hogo_-to7tv 4 года назад
What if I want to make a chrome extension
@sp--nt1gg
@sp--nt1gg 4 года назад
you came in a wrong place then
@mihneaaleman193
@mihneaaleman193 4 года назад
can you show us how to upload this on heroku? if you think this is helpful hit like so kyle can see it
@alg2x
@alg2x 4 года назад
Mihnea Aleman I can try to help
@ankitdutta5240
@ankitdutta5240 4 года назад
@@alg2x please help me
@ankitdutta5240
@ankitdutta5240 4 года назад
@@alg2x I am facing problem uploading the code..can you please help me?
@alg2x
@alg2x 4 года назад
Ankit Dutta hm sure do u have discord
@AnimalUnleashedHD
@AnimalUnleashedHD 3 года назад
@@alg2x Can you help me as well? Haha I have a Discord
@nothingness6254
@nothingness6254 5 лет назад
Can users on other internet and other computers use the same link?
@WebDevSimplified
@WebDevSimplified 5 лет назад
They can if you host the site somewhere with a domain. They cannot access your localhost though.
@therandomsomeone.
@therandomsomeone. 3 года назад
i just can't read this code
@310-q1c
@310-q1c 4 года назад
the tags do not work. I even tried to download the GitHub files, but they did not run
@p0o9i8z
@p0o9i8z 3 года назад
Obviously, no one can trouble-shoot your code without seeing it, but if I were to guess, I would say that there are 2 things that are most likely the source of your problem. 1. Hopefully you noticed that some ( but not all ) of those ejs tags have an equal sign on the left-hand side. One misplaced equal sign is a disaster in the world of ejs. But honestly, if you downloaded the code from Git Hub, and they didn't run either, this is probably not your problem. Because presumably, the Git Hub files would be correct. 2. Another possibility is outlined in a great article that you can find on the Internet. I will describe it so you will know what to expect. This guy tells you to get a picture of a kitten.jpg so that you can find out which statement you need to use to fix your problems. Then he gives you 3 choices. You try choice 1, and test it with the kitten picture. Then you try choice 2, and test it with the kitten picture. Then you try choice 3, and test it with the kitten picture. For me, choice 3 was the one that worked. You have to put the kitten in a certain folder, and then try each choice, one at a time. The name of the article is: "Serving static files in Express", and you can find it here: expressjs.com/en/starter/static-files.html By the way, he tells you that you need to use the "path" module, from Node.js, but he never tells you to "require" the path Module. Without "path", choice 3 ( which I mentioned above ) will never work.
@mahanthd9915
@mahanthd9915 4 года назад
I'm using visual studio code when i run the code its giving me an error .
@sp--nt1gg
@sp--nt1gg 4 года назад
what error is this
Далее
Learn Socket.io In 30 Minutes
27:27
Просмотров 503 тыс.
Build a Real Time Chat App With Node.js And Socket.io
17:12
I Built a SECRET Lamborghini Dealership!
33:02
Просмотров 9 млн
Socket IO Rooms Tutorial (Backend part 1)
17:35
Просмотров 42 тыс.
I Stopped Using Express.js: Because Bun and Hono 🔥
10:23
How To Create A Messaging App With Socket.io And React
1:44:08
Socket.io Introduction - How to Build a Chat App
21:38
programming projects that taught me how to code
9:49
Просмотров 294 тыс.