Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Callable

Index

Properties

route

route: string

stack

Methods

addListener

  • addListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): Array<string | symbol>
  • Returns Array<string | symbol>

getMaxListeners

  • getMaxListeners(): number

Private handle

  • Handle server requests, punting them down the middleware stack.

    Parameters

    Returns void

listen

  • listen(port: number, hostname?: undefined | string, backlog?: undefined | number, callback?: Function): Server
  • listen(port: number, hostname?: undefined | string, callback?: Function): Server
  • listen(path: string, callback?: Function): Server
  • listen(handle: any, listeningListener?: Function): Server
  • 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);
    api

    public

    Parameters

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

    Returns Server

  • Parameters

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

    Returns Server

  • Parameters

    • path: string
    • Optional callback: Function

    Returns Server

  • Parameters

    • handle: any
    • Optional listeningListener: Function

    Returns Server

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

off

  • off(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

on

  • on(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

once

  • once(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependListener

  • prependListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeListener

  • removeListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

setMaxListeners

  • setMaxListeners(n: number): this

use

  • 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

Generated using TypeDoc