@signumjs/http
Version:
SignumJS Generic Http Module
24 lines • 833 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.HttpClientFactory = void 0;
const httpAdapterFetch_1 = require("./httpAdapterFetch");
/**
* Factory for clients of {@link Http}
*
* @module http
*/
class HttpClientFactory {
/**
* Creates an Http instance backed by the platform's native `fetch`.
*
* Works in browsers, Node.js >= 18, Deno, Bun and Cloudflare Workers.
*
* @param baseUrl The base/root host url for the adapter, i.e. https://contoso.com
* @param options Optional {@link HttpClientOptions} applied to every request.
*/
static createHttpClient(baseUrl, options) {
return new httpAdapterFetch_1.HttpAdapterFetch(baseUrl, options);
}
}
exports.HttpClientFactory = HttpClientFactory;
//# sourceMappingURL=httpClientFactory.js.map