Lambda Utility Methods

Here, you'll get familiar with Lambda utility methods and learn how to protect the application from abuse.

You have already used json-response.js to format JSON objects into something that Lambda can understand, but this method loaded the CORS origin from the process environment, which should be the responsibility of the Lambda entry point. You can remove the process variable and add it as another regular argument, which makes this method easy to test.

Get hands-on with 1000+ tech skills courses.