typelevel / feral

Feral cats are homeless, feral functions are serverless
Apache License 2.0
174 stars 41 forks source link

Support Vercel #420

Open armanbilge opened 11 months ago

armanbilge commented 11 months ago

Documentation: https://vercel.com/docs/functions/serverless-functions/runtimes/node-js#advanced-node.js-usage

Vercel expects you to export a function whose signature is compatible with the argument to Node.js createServer method.

Fortunately there is already an implementation of such a function in http4s.

https://github.com/http4s/http4s/blob/ec939b1b354843d53293d4f9a9ac0e205fd4ec47/client-testkit/js/src/main/scala/org/http4s/client/testkit/scaffold/ServerScaffold.scala#L70-L72

Chingles2404 commented 4 months ago

Hi! I will be working on this :D

armanbilge commented 2 months ago

Ching has been working on this in https://github.com/typelevel/feral/pull/492. Unfortunately it turns out that Vercel is not very flexible i.e. it lacks support for dynamic routing which is required to support http4s HttpApp, see https://github.com/typelevel/feral/pull/492#issuecomment-2211980343 for additional details. So I think until Vercel supports that (or we can find some clever workaround) we will have to keep this integration on ice 😕