Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

deneme-9 (socket.io)

node v8.17.0
version: 1.0.0
endpointsharetweet
app=require('http').createServer(handler); io=require('socket.io')(app); app.listen(3000); function handler(req,res){ var veri=`<!DOCTYPE html> <html> <head> <script src='/socket.io/socket.io.js'></script> <script> var socket=io('/'); socket.on('news',function(data){ console.log(data); socket.emit('my other event',{my:'data'});}); </script> </head> <body> </body> </html>`; res.writeHead(200, {'Content-Type': 'text/html'}); res.end(veri); } io.on('connection',function(socket){ socket.emit('news',{hello:'world'}); socket.on('my other event',function(data){ console.log(data); }); });
//console.log(process.env.RUNKIT_ENDPOINT_URL); //process.env.RUNKIT_MOUNT_PATH
Loading…

no comments

    sign in to comment