Skip to content

probe-web / @probe-web/client / index / UrlSourceProvider

Class: UrlSourceProvider

Defined in: sources.ts:47

Serve sources from a URL. prefix is the build-time directory that base corresponds to: { base: '/src/fw/', prefix: '/home/ci/fw/' } maps /home/ci/fw/src/main.rs to /src/fw/src/main.rs. Paths outside prefix are not served.

Implements

Constructors

Constructor

ts
new UrlSourceProvider(opts): UrlSourceProvider;

Defined in: sources.ts:53

base: the URL the sources are served under. prefix: the build-time directory it corresponds to.

Parameters

ParameterType
opts{ base: string; prefix: string; }
opts.basestring
opts.prefixstring

Returns

UrlSourceProvider

Methods

resolve()

ts
resolve(path): Promise<string | null>;

Defined in: sources.ts:59

The path relative to prefix, or null if path is outside it.

Parameters

ParameterType
pathstring

Returns

Promise<string | null>

Implementation of

SourceProvider.resolve


read()

ts
read(path): Promise<string | null>;

Defined in: sources.ts:65

Fetch the file (once; results are cached). null if it is outside prefix or the fetch fails.

Parameters

ParameterType
pathstring

Returns

Promise<string | null>

Implementation of

SourceProvider.read