Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "net/disposable-http-server/docs/types/index.d"

Index

Interfaces

Type aliases

Functions

Type aliases

Binary

Binary: (error: Error | null, server: any) => void

Callback invoked after creating a server.

param

error object or null

param

server object

Type declaration

    • (error: Error | null, server: any): void
    • Parameters

      • error: Error | null
      • server: any

      Returns void

Callback

Callback: Nullary | Unary | Binary

Callback invoked after creating a server.

param

error object or null

param

server object

Nullary

Nullary: () => void

Callback invoked after creating a server.

Type declaration

    • (): void
    • Returns void

Unary

Unary: (error: Error | null) => void

Callback invoked after creating a server.

param

error object or null

Type declaration

    • (error: Error | null): void
    • Parameters

      • error: Error | null

      Returns void

Functions

Export assignment httpServer

  • Creates a disposable HTTP server.

    throws

    must provide valid options

    throws

    error encountered when starting server

    Parameters

    • options: Options

      server options

    • Optional clbk: Callback

      callback to invoke upon creating a server

    Returns void

    Example

    var opts = {
        'html': '<h1>Beep</h1>'
    };
    
    httpServer( opts, onReady );
    
    function onReady( error, server ) {
        if ( error ) {
            throw error;
        }
        server.close();
    }