Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • EventEmitter
    • Server

Callable

  • Server(req: IncomingMessage, res: ServerResponse<IncomingMessage>, next?: Function): void
  • Parameters

    • req: IncomingMessage
    • res: ServerResponse<IncomingMessage>
    • Optional next: Function

    Returns void

Index

Properties

Methods

Properties

route: string

Methods

  • handle(req: IncomingMessage, res: ServerResponse<IncomingMessage>, next: Function): void
  • Handle server requests, punting them down the middleware stack.

    Parameters

    • req: IncomingMessage
    • res: ServerResponse<IncomingMessage>
    • next: Function

    Returns void

  • listen(port: number, hostname?: string, backlog?: number, callback?: Function): Server<typeof IncomingMessage, typeof ServerResponse>
  • listen(port: number, hostname?: string, callback?: Function): Server<typeof IncomingMessage, typeof ServerResponse>
  • listen(path: string, callback?: Function): Server<typeof IncomingMessage, typeof ServerResponse>
  • listen(handle: any, listeningListener?: Function): Server<typeof IncomingMessage, typeof ServerResponse>
  • Listen for connections.

    This method takes the same arguments as node's http.Server#listen().

    HTTP and HTTPS:

    If you run your application both as HTTP and HTTPS you may wrap them individually, since your Connect "server" is really just a JavaScript Function.

     var connect = require('connect')
    , http = require('http')
    , https = require('https');

    var app = connect();

    http.createServer(app).listen(80);
    https.createServer(options, app).listen(443);

    Parameters

    • port: number
    • Optional hostname: string
    • Optional backlog: number
    • Optional callback: Function

    Returns Server<typeof IncomingMessage, typeof ServerResponse>

  • Parameters

    • port: number
    • Optional hostname: string
    • Optional callback: Function

    Returns Server<typeof IncomingMessage, typeof ServerResponse>

  • Parameters

    • path: string
    • Optional callback: Function

    Returns Server<typeof IncomingMessage, typeof ServerResponse>

  • Parameters

    • handle: any
    • Optional listeningListener: Function

    Returns Server<typeof IncomingMessage, typeof ServerResponse>

  • Utilize the given middleware handle to the given route, defaulting to /. This "route" is the mount-point for the middleware, when given a value other than / the middleware is only effective when that segment is present in the request's pathname.

    For example if we were to mount a function at /admin, it would be invoked on /admin, and /admin/settings, however it would not be invoked for /, or /posts.

    Parameters

    Returns Server

  • Parameters

    Returns Server

  • Parameters

    Returns Server

  • Parameters

    Returns Server