@fluidframework/request-handler Package

Packages > @fluidframework/request-handler

Classes

List of classes contained in this package or namespace
Class Description
RuntimeRequestHandlerBuilder The RuntimeRequestHandlerBuilder creates a runtime request handler based on request handlers. The provided handlers sequentially applied until one is able to satisfy the request.

Functions

List of functions contained in this package or namespace
Function Description
buildRuntimeRequestHandler(handlers)
handleFromLegacyUri(uri, runtime)

Variables

List of variables contained in this package or namespace
Variable Description
createFluidObjectResponse
innerRequestHandler

Type Aliases

List of type aliases contained in this package or namespace
Type Alias Description
RuntimeRequestHandler A request handler for the container runtime. Each handler should handle a specific request, and return undefined if it does not apply. These handlers are called in series, so there may be other handlers before or after. A handler should only return error if the request is for a route the handler owns, and there is a problem with the route, or fulling the specific request.

Functions

buildRuntimeRequestHandler

Signature:

export declare function buildRuntimeRequestHandler(...handlers: RuntimeRequestHandler[]): (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>;

Parameters

List of parameters
Parameter Type Description
handlers RuntimeRequestHandler[]

Returns:

(request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>

handleFromLegacyUri

Signature:

export declare function handleFromLegacyUri<T = IFluidObject & IFluidLoadable>(uri: string, runtime: IContainerRuntimeBase): IFluidHandle<T>;

Parameters

List of parameters
Parameter Type Description
uri string
runtime IContainerRuntimeBase

Returns:

IFluidHandle<T>

Variables

createFluidObjectResponse

Signature:

createFluidObjectResponse: (fluidObject: IFluidObject) => {
    status: number;
    mimeType: string;
    value: IFluidObject;
}

innerRequestHandler

Warning: This API is now obsolete.

  • please avoid adding new references to this API! It exposes internal container guts to external world, which is not ideal. It also relies heavily on internal routing schema (formation of handle URIs) which will change in future And last, but not least, it does not allow any policy to be implemented around GC of data stores exposed through internal URIs. I.e. if there are no other references to such objects, they will be GC’d and external links would get broken. Maybe that’s what is needed in some cases, but better, more centralized handling of external URI to internal handle is required (in future, we will support weak handle references, that will allow any GC policy to be implemented by container authors.)

Signature:

innerRequestHandler: (request: IRequest, runtime: IContainerRuntimeBase) => Promise<IResponse>

Type Aliases

RuntimeRequestHandler

A request handler for the container runtime. Each handler should handle a specific request, and return undefined if it does not apply. These handlers are called in series, so there may be other handlers before or after. A handler should only return error if the request is for a route the handler owns, and there is a problem with the route, or fulling the specific request.

Signature:

export declare type RuntimeRequestHandler = (request: RequestParser, runtime: IContainerRuntime) => Promise<IResponse | undefined>;