Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access js and css files from API gateway and lambda

I have an API Gateway in AWS that calls a a lambda function that returns some html. That html is then properly rendered on the screen but without any styles or js files included. How do I get those to the client as well? Is there a better method than creating /js and /css GET endpoints on the API Gateway to go get those files? I was hoping I could just store them in S3 and they'd get autoloaded from there.

like image 958
Scott Decker Avatar asked Apr 26 '26 11:04

Scott Decker


1 Answers

Store them on S3, and enable S3 static website hosting. Then include the correct URL to those assets in the HTML.

like image 191
Mark B Avatar answered Apr 29 '26 14:04

Mark B