AWS Lambda@Edge Hosting Documentation
Is your feature request related to a problem?
Currently there seems to be no documentation on how to host Qwik using AWS Lambda@Edge. Since this seems a perfect serverless hosting fit for Qwik and is one of the largest serverless solutions, it would be great if that was supported/documented to increase the uptake of Qwik.
Describe the solution you'd like
Provide documentation please.
Describe alternatives you've considered
Trying Express on Lambda, but wouldn't give the advantage and speed of Lambda@Edge.
Additional context
No response
Definitely do not use express. I haven't tried it, but I would start from there:
In a newly created qwik app (currently 0.9.0, run npm init qwik@latest to start) look at src/entry.ssr.tsx. You can build it (npm run build) and then import and invoke the default function from server/entry.ssr.js to the edge function handler.
Instead of using renderToStream, you can use renderToString, which contains the serialized html, as lambda@edge cannot handle stream chunks if I'm correct.
currently there is no integration for AWS. I will work on it 👨💻
Hi, just wondering if this is available yet?
Not yet, but I have a working code in my local environment. I need to fix up few e2e tests and then I can create the PR
Does this apply only to Lambda@Edge or also to regular Lambda? If it's only for edge lambdas, is there some documentation and best practices to deploy on S3 + Lambda (or amplify or similar)?
Here is the PR https://github.com/BuilderIO/qwik/pull/4390 @leifermendez drop it yesterday
Implemented!