axios.ts 322 B

1234567891011121314
  1. import { default as _axios } from "axios";
  2. export const axios = _axios.create({
  3. timeout: 1000 * 15,
  4. });
  5. export function baseAxiosOpts() {
  6. const authToken = process.env.GENIUS_ACCESS_TOKEN;
  7. return authToken && authToken.length > 0 ? {
  8. headers: {
  9. "Authorization": `Bearer ${authToken}`,
  10. },
  11. } : {};
  12. }