Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add integration with Qwik #486

Open
hckhanh opened this issue Feb 14, 2024 · 1 comment
Open

Add integration with Qwik #486

hckhanh opened this issue Feb 14, 2024 · 1 comment

Comments

@hckhanh
Copy link

hckhanh commented Feb 14, 2024

Is your feature request related to a problem? Please describe.

I think that Qwik integration should be added

@hckhanh
Copy link
Author

hckhanh commented Feb 23, 2024

I leave the wrapper here for someone needs it

import type { RequestHandler } from '@builder.io/qwik-city'

import { serve } from 'inngest/cloudflare'

import {
  createSkillIndex,
  deleteSkillIndex,
  createPostIndex,
  deletePostIndex,
} from '~/inngest/functions'
import inngest from '~/inngest'

const inngestRequest = serve({
  client: inngest,
  streaming: 'allow',
  signingKey: import.meta.env.VITE_INNGEST_SIGNING_KEY,
  functions: [createPostIndex, deletePostIndex, createSkillIndex, deleteSkillIndex],
})

const onRequest: RequestHandler = async ({ send, request, platform }) => {
  const response = await inngestRequest({
    request,
    env: platform.env as Record<string, undefined | string>,
  })
  send(response)
}

export const onGet = onRequest

export const onPost = onRequest

export const onPut = onRequest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant