Options
All
  • Public
  • Public/Protected
  • All
Menu

Basic class for embedded web server. This has an URL mapping built-in.

Hierarchy

  • CivetServer

Index

Constructors

constructor

Accessors

context

  • Returns MgContext

    the context or null if not running

userContext

  • get userContext(): any
  • generic user context which can be set/read, the server does nothing with this apart from keep it.

    Returns any

Methods

addAuthHandler

  • Adds a URI authorization handler. If there is existing URI authorization handler, it will be replaced with this one.

    URI's are ordered and prefix (REST) URI's are supported.

    Parameters

    • uri: string

      URI to match.

    • handler: ICivetAuthHandler

      authorization handler instance to use.

    Returns void

addHandler

  • Adds a URI handler. If there is existing URI handler, it will be replaced with this one.

    URI's are ordered and prefix (REST) URI's are supported.

    Parameters

    • uri: string

      URI to match.

    • handler: ICivetHandler

      handler instance to use.

    Returns void

addWebSocketHandler

  • Adds a WebSocket handler for a specific URI. If there is existing URI handler, it will be replaced with this one.

    URI's are ordered and prefix (REST) URI's are supported.

    Parameters

    Returns void

removeAuthHandler

  • removeAuthHandler(uri: string): void
  • Removes an authorization handler.

    Parameters

    • uri: string

      the exact URL used in addAuthHandler().

    Returns void

removeHandler

  • removeHandler(uri: String): void
  • Removes a handler.

    Parameters

    • uri: String

      the exact URL used in addHandler().

    Returns void

removeWebSocketHandler

  • removeWebSocketHandler(uri: String): void
  • Removes a web socket handler.

    Parameters

    • uri: String

      the exact URL used in addWebSocketHandler().

    Returns void

Generated using TypeDoc