Open alexcroox opened 3 years ago
@alexcroox I've been working through the best way to deploy using this project lately myself. I'm a huge fan of serverless framework, but the hoops you'd have to jump through to make this fit within the serverless framework probably isn't worth it. From what I've seen with the current state of the project the easiest way to deploy and update the lambda is going to be with the AWS cli. From what I've found, here's how I set up the project. Would really love to see some official documentation on how to deploy. If there's an easier way I'd love to hear it!
Basically what I had to do was
aws lambda update-function-code --function-name YOUR_FUNCTION_NAME --zip-file fileb://./dist/nuxt.zip
/{proxy+}
*.*
so that it'll pick up any file with an extension. Anything that doesn't have a file extension will fall through to the custom nuxt SSR origin then. You should be able to hit your cloudfront distribution URL to see your project with SSR running! At that point you'll have to setup DNS and your own certificates, but there are plenty of tutorials for that.
Hopefully that gets you pointed in the right direction!
Do you think it would be worth including a serverless framework yml file as an example about how one might deploy this optimally and easily to Lambda? Especially if you recommend not serving the assets it would useful to see the Cloudfront config that directs traffic to the S3 origin for non html requests.