Have ideas to improve npm?Join in the discussion! »

    @loopback/http-server
    TypeScript icon, indicating that this package has built-in type declarations

    2.5.1 • Public • Published

    @loopback/http-server

    This package implements the HTTP / HTTPS server endpoint for LoopBack 4 apps.

    Overview

    This is an internal package used by LoopBack 4 for creating HTTP / HTTPS server.

    Installation

    To use this package, you'll need to install @loopback/http-server.

    npm i @loopback/http-server

    Usage

    @loopback/http-server should be instantiated with a request handler function, and an HTTP / HTTPS options object.

    const httpServer = new HttpServer(
      (req, res) => {
        res.end('Hello world');
      },
      {port: 3000, host: ''},
    );

    Instance methods of HttpServer.

    Method Description
    start() Starts the server
    stop() Stops the server

    Instance properties of HttpServer.

    Property Description
    address Address details
    host host of the server
    port port of the server
    protocol protocol of the server
    url url the server

    Contributions

    Tests

    Run npm test from the root folder.

    Contributors

    See all contributors.

    License

    MIT

    Keywords

    none

    Install

    npm i @loopback/http-server

    DownloadsWeekly Downloads

    37,005

    Version

    2.5.1

    License

    MIT

    Unpacked Size

    26.3 kB

    Total Files

    11

    Last publish

    Collaborators

    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar