Skip to main content

Class: ExpressHttpAdapter

An HTTP adapter for integrating Express.js with the HTTP Plugin.

Implements​

Constructors​

Constructor​

new ExpressHttpAdapter(options): ExpressHttpAdapter

Parameters​

options​

ExpressHttpPluginOptions

Returns​

ExpressHttpAdapter

Methods​

getHttpServer()​

getHttpServer(): HttpServer

Retrieves the underlying HTTP server instance used by the adapter.

Returns​

HttpServer

The HTTP server instance, which can be of type http.Server, https.Server, http2.Http2Server, or http2.Http2SecureServer.

Implementation of​

HttpAdapter.getHttpServer


getRegisteredRoutes()​

getRegisteredRoutes(): readonly RouteDefinition[]

Retrieves the registered routes from the adapter.

Returns​

readonly RouteDefinition[]

An array of route definitions that have been registered with the adapter.

Implementation of​

HttpAdapter.getRegisteredRoutes


initialize()​

initialize(): Promise<void>

Initializes the HTTP adapter.

Returns​

Promise<void>

A promise that resolves when the adapter has been initialized, or void if the operation is synchronous.

Implementation of​

HttpAdapter.initialize


registerRoutes()​

registerRoutes(routes): void

Registers the provided routes with the adapter.

Parameters​

routes​

readonly RouteDefinition[]

An array of route definitions to be registered.

Returns​

void

A promise that resolves when the routes have been registered, or void if the operation is synchronous.

Implementation of​

HttpAdapter.registerRoutes


start()​

start(): void

Starts the HTTP adapter.

Returns​

void

A promise that resolves when the adapter has been started, or void if the operation is synchronous.

Implementation of​

HttpAdapter.start


stop()​

stop(): void

Stops the HTTP adapter.

Returns​

void

A promise that resolves when the adapter has been stopped, or void if the operation is synchronous.

Implementation of​

HttpAdapter.stop