diff --git a/src/api.ts b/src/api.ts new file mode 100644 index 0000000..aa72d80 --- /dev/null +++ b/src/api.ts @@ -0,0 +1,27 @@ +import axios, { AxiosInstance, AxiosRequestConfig } from 'axios'; + +// Const +const BASE_URL = 'https://kidshift-beta.nem.one'; +const TIMEOUT = 5000; + +class ApiClient { + private client: AxiosInstance; + + constructor() { + this.client = axios.create({ + baseURL: BASE_URL, + timeout: TIMEOUT, + }); + } + + private getHeaders(includeToken: boolean): Record { + const headers: Record = { + 'Content-Type': 'application/json', + }; + if (includeToken) { + const token = 'placeholder_token'; + headers['Authorization'] = `Bearer ${token}`; + } + return headers; + } +}