Code Monkey home page Code Monkey logo

Comments (5)

danieljee avatar danieljee commented on June 1, 2024

Same here. I need access to the underlying http server object for other purposes such as WebSocket.

from inversify-express-utils.

leandrocurioso avatar leandrocurioso commented on June 1, 2024

Any ideas?

from inversify-express-utils.

matewilk avatar matewilk commented on June 1, 2024

+1
Is there any way, in particular I'm looking to use InversifySocketUtils so would be happy if there was an option to at least get the underlying https server instance.

from inversify-express-utils.

davx1992 avatar davx1992 commented on June 1, 2024

Hi All,
maybe it would be useful for you, this is how I got Http instance.

        const inversifyExpressServer = new InversifyExpressServer(container);
        inversifyExpressServer.setConfig((app) => {
            // add body parser
            app.use(
                bodyParser.urlencoded({
                    extended: true,
                }),
            );
            app.use(bodyParser.json());
        });

        let app = inversifyExpressServer.build();

        const server = http.createServer(app);
        server.listen(port)

As you see after build we get express app instance. This instance could be fed to http.createServer and then server.listen(port).

from inversify-express-utils.

PodaruDragos avatar PodaruDragos commented on June 1, 2024

@davx1992 's solution is corect.
app is just an express app not an http server.

from inversify-express-utils.

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.