inngest / inngest-js

The developer platform for easily building reliable workflows with zero infrastructure for TypeScript & JavaScript
https://www.inngest.com/
GNU General Public License v3.0
440 stars 43 forks source link

Vercel/node serve handler #288

Closed cohlar closed 1 year ago

cohlar commented 1 year ago

Summary

Fixes https://github.com/inngest/inngest/issues/553

FYI - I have tested the Express serve handler on Vercel node serverless functions, and it failed to deploy. I do not know what server framework Vercel uses under the hood, but the Request and Response are wrapped differently from Express.

Checklist

Related

changeset-bot[bot] commented 1 year ago

⚠️ No Changeset found

Latest commit: ff01e8719cc6c0ff834adf7f72ccb9981bc3c14f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

jpwilliams commented 1 year ago

Hi, @cohlar!

Thanks for this. It does indeed look like the shape of Vercel's request is different than a regular Express payload.

I'd love to get this working with the regular "inngest/express" handler. Would you mind trying out installing inngest@express and seeing if that works for you?

npm install inngest@express

I made a few tweaks based on your handler here to see if it fixes the problems you're seeing. 🙂

cohlar commented 1 year ago

Hi @jpwilliams,

I just tested it and it works perfectly 👍

Thank you!

cohlar commented 1 year ago

Btw, FYI I think under the hood, vercel uses Node's built-in http for the server (see here), not express.

jpwilliams commented 1 year ago

Closing this in favour of #290 and will add some tests around it. Thanks for your help, @cohlar!