Jump to content
ESCAPE98

CHATROOM Tutorial

Recommended Posts

Salut, in acest tutorial o sa arat cum putem face un ChatRoom (Cu tot cu host).

Pasul 1 - Ne facem cont pe Repl.It (Ne putem loga si cu gmail). Eu am un cont facut special pentru tutoriale pe acest forum.

Link: https://repl.it/

Pasul 2 - Facem un repl de Nodejs si il numim "server" (sau ce nume vrem).

Pasul 3 - Pe langa index.js facem 2 fisiere numite: package-lock.json; package.json.

Pasul 4 - In index.js copypaste la urmatorul cod: https://pastebin.com/pfNEcACv

Pasul 5 - In package-lock.json copypaste la urmatorul cod: https://pastebin.com/2dRvEwvt

Pasul 6 - In package.json copypaste la urmatorul cod: https://pastebin.com/Fjg073BQ

Pasul 7 - Dam run la repl-u' nostru, asteptam sa instaleze tot ce e de instalat si dupa ce termina copiam linku' de la repl-u' nostru (o sa avem nevoie de el mai tarziu):

cVGYXqB.png

Pasul 8 - Mai facem un repl de nodejs si il numim "ChatRoom" (sau ce nume vrem).

Pasul 9 - Pe langa index.js facem 2 fisiere numite: package-lock.json; package.json.

Pasul 10 - In index.js copypaste la urmatorul cod: https://pastebin.com/a5j9MPNa

Pe linia de cod 4 unde scrie: var socket = io("Link"); in loc de "link" punem link-u' de la repl-u' ce-l facusem inainte. (Repl-u' cu numele server sau ce nume a-ti pus).

Pasul 11 - In package-lock.json copypaste la urmatorul cod: https://pastebin.com/sABUuGCB

Pasul 12 - In package.json copypaste la urmatorul cod: https://pastebin.com/xtgv9pMr

GATA DAM RUN SI DESCHIDEM LINK-U DE LA REPL-U' "CHATROOM" SAU CUM L-ATI NUMIT. SI IL DAM PERSOANEI CU CARE VREM SA COMUNICAM PE ACEL CHATROOM

jnMTrvd.gif

LINK DE LA CHATROOM-UL CE L-AM FACUT PENTRU ACEST TUTORIAL: https://chatroom.tutorialerepl.repl.run/

 

 

 

 

 

Edited by ESCAPE98
  • Like 1
  • Upvote 2
Link to comment
Share on other sites

26 minutes ago, c3m3d3 said:

Poti sa ne explici te rog, de ce ar fi nevoie si de package.json daca ai deja un package-lock.json?

 

"npm ERR! Unexpected token { in JSON at position 10872 while parsing near '...KxBk="
npm ERR!     }
npm ERR!   }
npm ERR! }
npm ERR! 
npm ERR! {
npm ERR!   "main": "index.j...'

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2019-09-15T14_40_55_530Z-debug.log


Repl.it: package installation failed!"
De-asta.

 

Link to comment
Share on other sites

Just now, ESCAPE98 said:

"npm ERR! Unexpected token { in JSON at position 10872 while parsing near '...KxBk="
npm ERR!     }
npm ERR!   }
npm ERR! }
npm ERR! 
npm ERR! {
npm ERR!   "main": "index.j...'

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2019-09-15T14_40_55_530Z-debug.log


Repl.it: package installation failed!"
De-asta.

 


Aha, si ce-nseamna asta?

Link to comment
Share on other sites

39 minutes ago, c3m3d3 said:

Poti sa ne explici te rog, de ce ar fi nevoie si de package.json daca ai deja un package-lock.json?

 

Dar mai pe scurt package.json ofera o varianta ez de a "urmări" pachetele care sunt utilizate în aplicație/program.

"

{
"main": "index.js",
"dependencies": {
"socket.io-client": "2.1.1",
"chalk": "2.4.1",
"prompts": "1.2.0"
}
}

"

wow

Edited by ESCAPE98
  • Downvote 1
Link to comment
Share on other sites

Just now, ESCAPE98 said:

Dar mai pe scurt package.json ofera o varianta ez de a "urmări" pachetele care sunt utilizate în aplicație.

"

{
"main": "index.js",
"dependencies": {
"socket.io-client": "2.1.1",
"chalk": "2.4.1",
"prompts": "1.2.0"
}
}

"

wow


Aha, si package-lock.json ce face? 

Puneti ba mana si invatati ce fac tool-urile pe care le folositi. Voi chiar puteti sa fiti multumiti de voi in halul asta? :( 

  • Confused 1
Link to comment
Share on other sites

15 minutes ago, c3m3d3 said:


Aha, si package-lock.json ce face? 

Puneti ba mana si invatati ce fac tool-urile pe care le folositi. Voi chiar puteti sa fiti multumiti de voi in halul asta? :( 

Bun ia spune-mi si mie ce fac tool-urile pe care le-am folosit in acest tutorial, sa fiu si eu multumit de mine.

Link to comment
Share on other sites

7 hours ago, ESCAPE98 said:

Salut, in acest tutorial o sa arat cum putem face un ChatRoom (Cu tot cu host).

Pasul 1 - Ne facem cont pe Repl.It (Ne putem loga si cu gmail). Eu am un cont facut special pentru tutoriale pe acest forum.

Link: https://repl.it/

Pasul 2 - Facem un repl de Nodejs si il numim "server" (sau ce nume vrem).

Pasul 3 - Pe langa index.js facem 2 fisiere numite: package-lock.json; package.json.

Pasul 4 - In index.js copypaste la urmatorul cod: https://pastebin.com/pfNEcACv

Pasul 5 - In package-lock.json copypaste la urmatorul cod: https://pastebin.com/2dRvEwvt

Pasul 6 - In package.json copypaste la urmatorul cod: https://pastebin.com/Fjg073BQ

Pasul 7 - Dam run la repl-u' nostru, asteptam sa instaleze tot ce e de instalat si dupa ce termina copiam linku' de la repl-u' nostru (o sa avem nevoie de el mai tarziu):

cVGYXqB.png

Pasul 8 - Mai facem un repl de nodejs si il numim "ChatRoom" (sau ce nume vrem).

Pasul 9 - Pe langa index.js facem 2 fisiere numite: package-lock.json; package.json.

Pasul 10 - In index.js copypaste la urmatorul cod: https://pastebin.com/a5j9MPNa

Pe linia de cod 4 unde scrie: var socket = io("Link"); in loc de "link" punem link-u' de la repl-u' ce-l facusem inainte. (Repl-u' cu numele server sau ce nume a-ti pus).

Pasul 11 - In package-lock.json copypaste la urmatorul cod: https://pastebin.com/sABUuGCB

Pasul 12 - In package.json copypaste la urmatorul cod: https://pastebin.com/xtgv9pMr

GATA DAM RUN SI DESCHIDEM LINK-U DE LA REPL-U' "CHATROOM" SAU CUM L-ATI NUMIT. SI IL DAM PERSOANEI CU CARE VREM SA COMUNICAM PE ACEL CHATROOM

jnMTrvd.gif

LINK DE LA CHATROOM-UL CE L-AM FACUT PENTRU ACEST TUTORIAL: https://chatroom.tutorialerepl.repl.run/

 

 

 

 

 

Ai explicat fain,Felicitari si bine ai venit.Incearca sa postezi ceva continut mai ok si nineni nu o sa mai zica nimic.BAFTA!

  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...