disconnect and nodemon

events
Gerardo Marx 4 weeks ago
parent 3255674aa2
commit e52307ee4d

3
.gitignore vendored

@ -0,0 +1,3 @@
node_modules/
package-lock.json
*.*.swp

@ -1,7 +1,7 @@
<html>
<body>
<h1> Hello Marx from index.html file </h1>
<p>This is some text</p>
<p>This is some new text recently added</p>
<script src='/socket.io/socket.io.js'></script>
<script>var socket = io();</script>
</body>

@ -13,6 +13,9 @@ app.get('/', (req, res) => {
io.on('connection', (socket) => {
console.log('A new user is connected');
socket.on('disconnect', ()=> {
console.log('User disconnected');
});
});
server.listen(3333, () => {

@ -4,7 +4,9 @@
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node index.js",
"dev": "nodemon index.js"
},
"keywords": [],
"author": "",
@ -12,5 +14,8 @@
"dependencies": {
"express": "^4.22.3",
"socket.io": "^4.8.4"
},
"devDependencies": {
"nodemon": "^3.1.14"
}
}

Loading…
Cancel
Save