Code Monkey home page Code Monkey logo

Comments (2)

JBrLloyd avatar JBrLloyd commented on August 20, 2024

Hi @usmailaabdoul!
Would you mind sharing your server.js?
I'm guessing without knowing the contents of your server.js, but do you have app.listen instead of server.listen? as server = http.createServer is the instance that is initialised with the socketio library

const express = require('express');
const socketio = require('socket.io');

const formatMessage = require('./utils/messages');
const constants = require('./utils/constants');

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

server.listen(PORT, () => console.log(`Server running on port ${PORT}`));

from chatcord.

usmailaabdoul avatar usmailaabdoul commented on August 20, 2024

Hello @JBrLloyd
Thanks for your response i actually used app.listen instead of server.listen,
been used to using to app.listen so couldn't see it to be the mistake, changing it fixed the problem thanks so much for your help 😊

from chatcord.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.