explorer-app/plugins/githubApi.ts

17 lines
299 B
TypeScript
Raw Normal View History

2024-09-12 18:03:06 +02:00
export default defineNuxtPlugin(() => {
const appConfig = useAppConfig()
const githubApi = $fetch.create({
baseURL: 'https://api.github.com',
headers: {
Authorization: `Bearer ${appConfig.github.accessToken}`,
},
})
return {
provide: {
githubApi,
},
}
})