UNPKG

dots-wrapper

Version:

Digital Ocean v2 api wrapper - javascript - typescript - nodejs

17 lines 629 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createContext = void 0; const createContext = ({ axios, requestTimeoutInMs = 1000 * 15, endpoint = 'https://api.digitalocean.com/v2', token, }) => { const headers = Object.freeze({ 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json', }); const httpClient = axios.create({ baseURL: endpoint, headers, timeout: requestTimeoutInMs, }); return Object.freeze({ endpoint, httpClient }); }; exports.createContext = createContext; //# sourceMappingURL=create-context.js.map