qwik icon indicating copy to clipboard operation
qwik copied to clipboard

AWS Lambda@Edge Hosting Documentation

Open BerndWessels opened this issue 3 years ago • 4 comments

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

BerndWessels avatar Sep 20 '22 22:09 BerndWessels

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.

wtho avatar Sep 21 '22 18:09 wtho

currently there is no integration for AWS. I will work on it 👨‍💻

gioboa avatar Mar 11 '23 21:03 gioboa

Hi, just wondering if this is available yet?

bernardhamann avatar May 11 '23 20:05 bernardhamann

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

gioboa avatar May 11 '23 20:05 gioboa

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)?

0cv avatar Jun 02 '23 11:06 0cv

Here is the PR https://github.com/BuilderIO/qwik/pull/4390 @leifermendez drop it yesterday

gioboa avatar Jun 02 '23 11:06 gioboa

Implemented!

manucorporat avatar Jul 01 '23 11:07 manucorporat