/
githubmirror
/
stackwise
Обзор
Документация
Войти
/
githubmirror
/
stackwise
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
app/api/stacks/create-stack-boilerplate/get-file-from-github.ts
14 строк
481 B
Silen Naihin
readability and restructuring
19 фев 2024, 00:00
19 фев 2024, 00:00
0fdf743
Код
Авторство
О чём код?
export default async function getFileFromGithub(path, token) { const owner = 'stackwiseai'; const repo = 'stackwise'; const sourceBranch = process.env.VERCEL_GIT_COMMIT_REF ?? ''; // or 'master', depending on your repository const url = `https://api.github.com/repos/${owner}/${repo}/contents/${path}?ref=main`; console.log(url, 'url'); const response = await fetch(url, { headers: { Authorization: `token ${token}`, }, }); return response.json(); }