Ask coding questions

← Back to all posts
How to keep chat server running?
AustinCharb (16)

Hello, I'm making a chat app, and I was wondering if there was a way to keep the server going, even while my computer is shut down. I have to keep typing node index.js to run the server. Is there any way to keep this going without having my computer on 24/7?

Answered by Coder100 (17133) [earned 5 cycles]
View Answer
Comments
hotnewtop
Coder100 (17133)

html repls don't support the .replit file that is used to make your webservers run.

You will have to use something else, like node.js

AustinCharb (16)

how could I go about making a node.js file? I'm new to all of this... @Coder100

Coder100 (17133)

oh no, click on my link, it creates a node repl you can copy and paste your code in. @AustinCharb

owaso (0)

@AustinCharb There are tutorials on the internet that do a better job: link

AustinCharb (16)

Do I copy every file besides the server file and put the server file code in the Node.js?
@Coder100

Coder100 (17133)

no, you put in that file called index.js
that's what the index.js is for @AustinCharb

AustinCharb (16)

oh so i need to rename main.js to index.js?
@Coder100

AustinCharb (16)

so would i rename main.js to index.js?
@Coder100