tanszek:oktatas:iss_t:group_chat_-_nodejs
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
tanszek:oktatas:iss_t:group_chat_-_nodejs [2024/04/07 15:05] – created superuser | tanszek:oktatas:iss_t:group_chat_-_nodejs [2024/04/07 15:06] (current) – superuser | ||
---|---|---|---|
Line 1: | Line 1: | ||
===== HTML - Javascript client ===== | ===== HTML - Javascript client ===== | ||
+ | |||
+ | index.html | ||
<sxh html> | <sxh html> | ||
Line 39: | Line 41: | ||
</ | </ | ||
+ | ===== NodeJs - server ===== | ||
+ | |||
+ | index.js | ||
+ | |||
+ | <sxh javascript> | ||
+ | var app = require(' | ||
+ | var http = require(' | ||
+ | var io = require(' | ||
+ | |||
+ | app.get('/', | ||
+ | res.sendFile(__dirname + '/ | ||
+ | }); | ||
+ | |||
+ | io.on(' | ||
+ | socket.on(' | ||
+ | io.emit(' | ||
+ | }); | ||
+ | }); | ||
+ | |||
+ | http.listen(3000, | ||
+ | console.log(' | ||
+ | }); | ||
+ | </ |
tanszek/oktatas/iss_t/group_chat_-_nodejs.1712502337.txt.gz · Last modified: 2024/04/07 15:05 by superuser