Share your repls and programming experiences

← Back to all posts
Node ChatRoom
h
RohilPatel (638)

this is a simple chat room I made. I haven't quite figured out how to keep messages permanent, so ya. Have fun!!!!!!!!!!!

New update: 5% credit to @AdCharity for adding some code.

Commentshotnewtop
ChezCoder (204)

nodejs chatrooms seem so easy! yet when you try the difficulty is next to impossible XD someone teach me da ways lol

RohilPatel (638)

I mean, I don't have a problem entirely teaching you, but I don't remember what exactly all of it means. @ChezCoder

RohilPatel (638)

Hmm, do u know how to use a txt file to do it? @AdCharity

RohilPatel (638)

So use the fs to save it, ok. @AdCharity Also, why do we only get 100MB if we have no hacker plan?

AdCharity (1112)

@RohilPatel because repl needs money. They can't host thousands of websites and code for free.

AdCharity (1112)

@RohilPatel 100MB is a lot for text.

RohilPatel (638)

My file called jade hardly has anything, and it uses 5 MB lol . @AdCharity

AdCharity (1112)

@RohilPatel well that's bs because I've saved entire novels on 5MB on LocalStorage

RohilPatel (638)

Then there must be a way to save space. Do u know how? @AdCharity

sycrepl (10)

@AdCharity The storage isn't only text. I think they also count server activity in storage, because there's no way I've typed 25000000 bytes of data...

AdCharity (1112)

@RohilPatel save space? I would just take down any static html pages that are sitting around and just download them.

Vandesm14 (2167)

@sycrepl It's all files, so your packages and modules also count (which tend to be the issue when it comes to storage)

AdCharity (1112)

and what happened to my credit

RohilPatel (638)

This post was made before you helped me. And I wasn't thinking right when u did it. @AdCharity

AdCharity (1112)

@RohilPatel :/ did I write code into it or not

TaylorLiang (773)

@RohilPatel bruh just credit him by editing the post

RohilPatel (638)

Oh yea, I can edit them lol. @TaylorLiang

JacksonCowie (281)

@RohilPatel Nice Job, you can store logs of the messages sent using Mongoose or even just in a text file.

HngTrnh (1)

amazing, good job! Keep developments! I'll share it

RohilPatel (638)

Thank you very much! Do u have any comments or concerns? Possibly any suggestions? Thanks once again! @HngTrnh

HngTrnh (1)

Hmmm, Maybe no because I think it's so great. But, May Can I know How many people can join in a [email protected]

RohilPatel (638)

U don't even need to worry about that! @HngTrnh

eekboi (80)

i have to go for now sorry.

RohilPatel (638)

Yikes! Let me know when ur back. I'm flexible thru the night. Thanks! Make a multiplayer repl pls also! @eekboi

eekboi (80)

@rohilpatel hey im the guy you were talking to on the chat, idk how to ping so yeah

RohilPatel (638)

U just do my actual name, which is @RohilPatel @eekboi

eekboi (80)

@RohilPatel i invited you to the multiplayer doc. join and if you have questions just ask

eekboi (80)

@RohilPatel after i teach you python can you teach me c++?

RohilPatel (638)

Ok. I'll get on it right now! @eekboi

RohilPatel (638)

I don't know c++, but I can try to teach u node. @eekboi

eekboi (80)

@RohilPatel im gonna be able to help in about 1 1/4 hours

eekboi (80)

@RohilPatel ok im on. join the document

RohilPatel (638)

Can u code Rn? I'm gonna join the document. @eekboi

eekboi (80)

im the dude on the thing

PDanielY (720)

You can use a mysql database to store messages. I made a post about this in learn before

RohilPatel (638)

Hmm. I don't really understand how to download the sql, and ur tutorial makes it seem as if you need to share private credentials. @PDanielY

RohilPatel (638)

How do I even get a database on repl? Like mongo for example? @MrEconomical

JacobMacLeod (11)

Can you store messages in a txt file?

syc1 (20)

@RohilPatel I once used a plain text file and jquery to make a chat. It worked, very badly, but it worked.

RohilPatel (638)

Could you elaborate on how u achieved this? Was there any database involved? @syc1

AdCharity (1112)

@RohilPatel fs = filesystem. naturally fs can write into files.

syc1 (20)

@RohilPatel no, no database. i just made it so when a text file updated anyone viewing the page would see it in their chatbox
no message saving

sycrepl (10)

@RohilPatel I honestly don't remember.