Example of an api endpoint build on AWS, using Lambda, API Gateway and S3. The Lambda function read a stream from a .csv file on S3, transform it in JSON and finally output it.
Usage and Query string parameters
curl https://xxxxxxxxx.execute-api.eu-south-1.amazonaws.com/api/flyers?page=1&limit=20&expired=0¬published=0
- limit (int > 0, default 100) | Row limit
- page (int > 0, default 1) | Page, based on limit setting
- expired (0 or 1, default 0) | ouput expired (end_date < now) records also
- notpublished (0 or 1, default 0) | ouput notpublished (is_published = 0) records also
Install dependencies: npm install
You need an AWS account.
Install and configure Serverless Framwork:
Set you preferred AWS region in "serverless.yml" (default eu-south-1)
Deploy on AWS sls deploy
Remove from your AWS account: sls remove