explorer-app/plugins/githubApi.ts
2024-09-12 18:03:06 +02:00

16 lines
299 B
TypeScript

export default defineNuxtPlugin(() => {
const appConfig = useAppConfig()
const githubApi = $fetch.create({
baseURL: 'https://api.github.com',
headers: {
Authorization: `Bearer ${appConfig.github.accessToken}`,
},
})
return {
provide: {
githubApi,
},
}
})