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

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

    8.0.4 • Public • Published

    @whook/http-server

    The Whook base HTTP server

    GitHub license NPM version

    The Whook's httpServer service is responsible for instanciating the NodeJS HTTP Server and handling its start/shutdown.

    It can be easily replaced by any other HTTP server (an HTTPS one for instance if you cannot use a gateway or a proxy to handle HTTPS connections).

    API

    Functions

    initHTTPServer(services)Promise.<HTTPServer>

    Initialize an HTTP server

    Typedefs

    HTTPServer

    initHTTPServer(services) ⇒ Promise.<HTTPServer>

    Initialize an HTTP server

    Kind: global function
    Returns: Promise.<HTTPServer> - A promise of an object with a NodeJS HTTP server in its service property.

    Param Type Default Description
    services Object The services the server depends on
    [services.ENV] Object The process environment variables
    services.ENV.DESTROY_SOCKETS String Whether the server sockets whould be destroyed or if the server should wait while sockets are kept alive
    services.HOST String The server host
    services.PORT Number The server port
    [services.MAX_HEADERS_COUNT] Number The https://nodejs.org/api/http.html#http_server_maxheaderscount
    [services.KEEP_ALIVE_TIMEOUT] Number See https://nodejs.org/api/http.html#http_server_keepalivetimeout
    [services.MAX_CONNECTIONS] Number See https://nodejs.org/api/net.html#net_server_maxconnections
    [services.SOCKET_TIMEOUT] Number See https://nodejs.org/api/http.html#http_server_timeout
    services.httpRouter function The function to run with the req/res tuple
    [services.log] function noop A logging function

    HTTPServer

    Kind: global typedef

    Authors

    License

    MIT

    Install

    npm i @whook/http-server

    DownloadsWeekly Downloads

    64

    Version

    8.0.4

    License

    MIT

    Unpacked Size

    71.8 kB

    Total Files

    16

    Last publish

    Collaborators

    • avatar