/
githubmirror
/
axios
Обзор
Документация
Войти
/
githubmirror
/
axios
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v1.15.2
scripts/axios-build-instance.js
24 строки
606 B
Jay
chore: remove all old and un-needed files (#10584)
30 мар 2026, 21:15
Не верифицирован
30 мар 2026, 21:15
a7f41f5
Код
Авторство
О чём код?
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, }, });