Skip to content

Commit c8f74da

Browse files
committed
feat: expose axios instance and interceptors to consumers
1 parent 2a4c6fe commit c8f74da

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nestjs-axios-promise",
3-
"version": "0.1.0",
3+
"version": "0.2.0",
44
"author": "Jason Raimondi <jason@raimondi.us>",
55
"main": "src/index.ts",
66
"files": [

src/axios.service.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ export class AxiosService {
88
protected readonly instance: AxiosInstance = Axios,
99
) {}
1010

11+
get axios(): AxiosInstance {
12+
return this.instance;
13+
}
14+
15+
get interceptors() {
16+
return this.instance.interceptors;
17+
}
18+
1119
request<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R> {
1220
return this.instance.request<T, R, D>(config);
1321
}

0 commit comments

Comments
 (0)