axios-axios/scripts/axios-build-instance.js
Jay a7f41f5bb5
chore: remove all old and un-needed files (#10584)
* chore: remove all old and un-needed files

* chore: fix missing file

* chore: fix ref error

* chore: add back missing file

* chore: incorrect folder location

* chore: ignore ts issues
2026-03-30 20:15:15 +02:00

25 lines
606 B
JavaScript

import axios from '../index.js';
const { GITHUB_TOKEN } = process.env;
GITHUB_TOKEN ? console.log(`[GITHUB_TOKEN OK]`) : console.warn(`[GITHUB_TOKEN is not defined]`);
const defaultTransform = axios.defaults.transformRequest;
export default axios.create({
transformRequest: [
defaultTransform[0],
function (data) {
console.log(
`[${this.method.toUpperCase()}] Request [${new URL(axios.getUri(this)).pathname}]`
);
return data;
},
],
baseURL: 'https://api.github.com/',
headers: {
Authorization: GITHUB_TOKEN ? `token ${GITHUB_TOKEN}` : null,
},
});