Skip to content
This repository was archived by the owner on Jul 23, 2021. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions example/handler.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const reponseHeadersJson = {
const responseHeadersJson = {
'Access-Control-Allow-Origin': '*', // Required for CORS support to work
'Access-Control-Allow-Credentials': true,
'Access-Control-Expose-Headers': 'link',
Expand All @@ -18,7 +18,7 @@ module.exports.router = (event, context, callback) => {
}

function exampleMessageGet (event, context, callback) {
let headers = reponseHeadersJson
let headers = responseHeadersJson
let scheme = event.headers['X-Forwarded-Proto']
let host = event.headers.Host
let path = event.requestContext.path.replace('example/message','example/do-something')
Expand All @@ -37,7 +37,7 @@ function exampleDoSomethingPost (event, context, callback) {
if (body.constructor !== Array) {
return {
statusCode: 400,
headers: reponseHeadersJson,
headers: responseHeadersJson,
body: JSON.stringify({
message: 'The supplied request body must be a JSON array',
statusCode: '400'
Expand All @@ -47,7 +47,7 @@ function exampleDoSomethingPost (event, context, callback) {
let itemCount = body.length
return {
statusCode: 200,
headers: reponseHeadersJson,
headers: responseHeadersJson,
body: JSON.stringify({
result: 'Thanks for sending that data',
submittedItems: itemCount
Expand Down