-
Notifications
You must be signed in to change notification settings - Fork 43
support SSR requests #117
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe.
This topic have appeared some time ago but back then, I was not able to make it work. Today I managed to find a way to be able to send a request to Algolia from useAsyncData but it is not very elegant.
const { pending } = await useAsyncData('test', async () => {
app.$algolia.transporter.requester = await (await import('@algolia/requester-node-http').then(lib => lib.default || lib)).createNodeHttpRequester()
await search({ query: 'Samsung' })
})As a part of this issue, I would like to create a new configuration entry nodeRequester that when set to true, it will create a new global object in nuxt App called algoliaNode so that later in useAlgoliaSearch composable users could do something like this:
const { pending } = await useAsyncData('test', () => search({ query: 'Samsung' , requester: 'node'}))Describe the solution you'd like
Describe alternatives you've considered
Additional context
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request