Skip to content

Commit

Permalink
Merge pull request #34 from BilligsterUser/custom-axios-instance
Browse files Browse the repository at this point in the history
allow custom axios instance
  • Loading branch information
gandlafbtc committed Apr 1, 2023
2 parents 6184ce3 + badc559 commit 45b0ef5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/CashuMint.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import axios from 'axios';
import { axios } from './axios.js';
import {
CheckSpendablePayload,
CheckSpendableResponse,
Expand Down
8 changes: 8 additions & 0 deletions src/axios.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import * as _axios from 'axios';
import { CreateAxiosDefaults } from 'axios';

export let axios = _axios.default.create();
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function setupAxios(config?: CreateAxiosDefaults<any> | undefined) {
axios = _axios.default.create(config);
}

0 comments on commit 45b0ef5

Please sign in to comment.