Skip to content

Commit

Permalink
chore: add client configuration for Axiox
Browse files Browse the repository at this point in the history
  • Loading branch information
ghoshRitesh12 committed Aug 5, 2024
1 parent b76343f commit 9c9d781
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/config/client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import axios, { AxiosError, type AxiosRequestConfig } from "axios";
import {
// SRC_BASE_URL,
ACCEPT_HEADER,
USER_AGENT_HEADER,
ACCEPT_ENCODING_HEADER,
} from "../utils/constants.js";

const clientConfig: AxiosRequestConfig = {
timeout: 8000,
// baseURL: SRC_BASE_URL,
headers: {
Accept: ACCEPT_HEADER,
"User-Agent": USER_AGENT_HEADER,
"Accept-Encoding": ACCEPT_ENCODING_HEADER,
},
};

const client = axios.create(clientConfig);

export { client, AxiosError };

0 comments on commit 9c9d781

Please sign in to comment.