Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Serverless Programming Cookbook

You're reading from  Serverless Programming Cookbook

Product type Book
Published in Jan 2019
Publisher Packt
ISBN-13 9781788623797
Pages 490 pages
Edition 1st Edition
Languages
Concepts
Author (1):
Heartin Kanikathottu Heartin Kanikathottu
Profile icon Heartin Kanikathottu
Toc

Table of Contents (12) Chapters close

Preface 1. Getting Started with Serverless Computing on AWS 2. Building Serverless REST APIs with API Gateway 3. Data Storage with Amazon DynamoDB 4. Application Security with Amazon Cognito 5. Web Hosting with S3, Route53, and CloudFront 6. Messaging and Notifications with SQS and SNS 7. Redshift, Amazon ML, and Alexa Skills 8. Monitoring and Alerting with Amazon CloudWatch 9. Serverless Programming Practices and Patterns 10. Other Cloud Providers 11. Other Books You May Enjoy

Mapping requests and responses with mapping templates

Amazon API Gateway allows us to map our incoming requests to a format that's required by our Lambda, and map the response from the Lambda into a format that's required by the client, all by using the mapping templates. The API Gateway body mapping templates are based on the Apache Velocity Template Language (VTL) and JSONPath expressions.

In this recipe, we will see how to map a JSON body coming from a request into another JSON structure, as required by the backend (Lambda). We will also map the JSON response from the backend (Lambda) into a different JSON response structure which is sent back as the response. We will use the same Lambda from the recipe Building your first API with Lambda integration, but the client will send the request in a different format.

...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime