15 lines
290 B
TypeScript
15 lines
290 B
TypeScript
export default defineNuxtPlugin(() => {
|
|
const config = useRuntimeConfig()
|
|
|
|
const myfetch = $fetch.create({
|
|
baseURL: import.meta.server ? config.apiBase : config.public.apiBase,
|
|
onRequest({ options }) {
|
|
},
|
|
})
|
|
|
|
return {
|
|
provide: {
|
|
myfetch: myfetch,
|
|
},
|
|
}
|
|
}) |