Answers for "js import socket.io"

2

html socket io import

<script src="/socket.io/socket.io.js"></script>
Posted by: Guest on March-18-2021
0

socket io nodejs

const express = require('express');const app = express();const http = require('http');const server = http.createServer(app);const { Server } = require("socket.io");const io = new Server(server);app.get('/', (req, res) => {  res.sendFile(__dirname + '/index.html');});io.on('connection', (socket) => {  console.log('a user connected');});server.listen(3000, () => {  console.log('listening on *:3000');});
Posted by: Guest on May-26-2021
0

socket io import es6

const app = express(); const server = http.Server(app); const io = new Server(server);
Posted by: Guest on September-04-2021

Browse Popular Code Answers by Language