Search code examples
javascriptnode.jsamazon-s3aws-lambdaaws-api-gateway

Serving a static file through AWS Lambda


I would like to serve a small PNG file through an AWS Lambda endpoint.

However, I don't think it's possible because I want the file extension in the route. My goal:

GET /image.png

I do not think I can use AWS S3 because I want to trigger a function when they GET the image.

Any help would be greatly appreciated!


Solution

  • However, I don't think it's possible because I want the file extension in the route.

    You can have a file extension as part of the API Gateway route. There is no limitation preventing you from doing this.