Skip to main content
Version: v1

InsecureUrlResolver Class

As the name implies this is not secure and should not be used in production. It simply makes the example easier to get up and running.

In our example we run a simple web server via webpack-dev-server. This defines a URL format of the form http://localhost:8080//.

We then need to map that to a Fluid based URL. These are of the form fluid://orderingUrl///.

The tenantId/documentId pair defines the 'full' document ID the service makes use of. The path is then an optional part of the URL that the document interprets and maps to a data store. It's exactly similar to how a web service works or a router inside of a single page app framework.

Signature​

export declare class InsecureUrlResolver implements IUrlResolver

Implements: IUrlResolver

Constructors​

ConstructorDescription
(constructor)(hostUrl, ordererUrl, storageUrl, tenantId, bearer, isForNodeTest)Constructs a new instance of the InsecureUrlResolver class

Methods​

MethodReturn TypeDescription
createCreateNewRequest(fileName)IRequest
getAbsoluteUrl(resolvedUrl, relativeUrl)Promise<string>
resolve(request)Promise<IResolvedUrl | undefined>

Constructor Details​

(constructor)​

Constructs a new instance of the InsecureUrlResolver class

Signature​

constructor(hostUrl: string, ordererUrl: string, storageUrl: string, tenantId: string, bearer: string, isForNodeTest?: boolean);

Parameters​

ParameterModifiersTypeDescription
hostUrlstring
ordererUrlstring
storageUrlstring
tenantIdstring
bearerstring
isForNodeTestoptionalboolean

Method Details​

createCreateNewRequest​

Signature​

createCreateNewRequest(fileName?: string): IRequest;

Parameters​

ParameterModifiersTypeDescription
fileNameoptionalstring

Returns​

Return type: IRequest

getAbsoluteUrl​

Signature​

getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string>;

Parameters​

ParameterTypeDescription
resolvedUrlIResolvedUrl
relativeUrlstring

Returns​

Return type: Promise<string>

resolve​

Signature​

resolve(request: IRequest): Promise<IResolvedUrl | undefined>;

Parameters​

ParameterTypeDescription
requestIRequest

Returns​

Return type: Promise<IResolvedUrl | undefined>