Express Server Sockjs
You may found the SockJS express example usefull:
https://github.com/sockjs/sockjs-node/tree/dev/examples/express
UnAngeloCheSiChiamaTheKing
You may found the SockJS express example usefull:
https://github.com/sockjs/sockjs-node/tree/dev/examples/express
const express = require("express");
const http = require("http");
const socketIo = require("socket.io");
const port = process.env.PORT || 8001;
const index = require("./routes/index");
const app = express();
app.use(index);
const server = http.createServer(app);
const io = socketIo(server); // < Interesting!
const getApiAndEmit = "TODO";
const app = require("express")();const httpServer = require("http").createServer(app);const options = { /* ... */ };const io = require("socket.io")(httpServer, options);io.on("connection", socket => { /* ... */ });httpServer.listen(3000);// WARNING !!! app.listen(3000); will not work here, as it creates a new HTTP server
import express from express