Skip to content

Commit

Permalink
feat(roadiz): add useRoadizDocumentUrl()
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelodelain committed Mar 15, 2024
1 parent 9372766 commit 774bc12
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions composables/use-roadiz-document-url.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { joinURL } from 'ufo'

export function useRoadizDocumentUrl(path?: string) {
const runtimeConfig = useRuntimeConfig()

return joinURL(
(runtimeConfig.public.api?.url || runtimeConfig.public.site?.url || '') as string,
runtimeConfig.public.roadiz?.documentPath || '',
path || '',
)
}
3 changes: 3 additions & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ export default defineNuxtConfig({
url: '',
endpointPrefix: '/api',
},
roadiz: {
documentPath: '/files',
},
},
},
})

0 comments on commit 774bc12

Please sign in to comment.