Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

socket.io with express

// npm i socket.io
const http = require('http')
const express = require('express')
const socketio = require('socket.io')

const app = express()
const server = http.createServer(app)
const io = socketio(server)

const port = process.env.PORT || 3000

server.listen(port, () => {
  console.log(`Server is up on port ${port}!`)
})
 
PREVIOUS NEXT
Tagged: #express
ADD COMMENT
Topic
Name
2+8 =